-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
good first issueGood for newcomersGood for newcomers
Description
Summary
Add support for custom serializers in the checkpoint/pause-resume system. This allows users to define how their custom objects are serialized and deserialized during agent execution pauses.
Context
The current checkpoint system (src/opensymbolicai/checkpoint.py) handles pause/resume for distributed execution. However, it may not gracefully handle custom object types that users define in their agents.
Expected Behavior
Users should be able to register custom serializers:
from opensymbolicai import register_serializer
@register_serializer(MyCustomClass)
class MyCustomSerializer:
def serialize(self, obj: MyCustomClass) -> dict:
return {"field": obj.field}
def deserialize(self, data: dict) -> MyCustomClass:
return MyCustomClass(field=data["field"])Implementation Hints
- Add a serializer registry in
checkpoint.py - Provide a decorator or registration function
- Fall back to default JSON/pickle behavior if no custom serializer is found
- Consider using Pydantic's serialization capabilities
Acceptance Criteria
- Implement serializer registry
- Add
@register_serializerdecorator or equivalent API - Add unit tests for custom serialization round-trips
- Add integration test with a real pause/resume cycle
- Document usage in docstrings
Files to Look At
- src/opensymbolicai/checkpoint.py — checkpoint/resume logic
- src/opensymbolicai/models.py — Pydantic models for reference
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
good first issueGood for newcomersGood for newcomers