agent-sdk-ts is basically a transpilation of the original python SDK that we can find at enyst/agent-sdk (it’s a fork for our use). Clone yourself agent-sdk so you have the original codebase and you can understand the code deeply before transpiling.
Gap
Python persistence is multi-process safe (FIFO locks) and has defined constants + diffing utilities. TS FileStore appends to events.jsonl with no locking, making it vulnerable to corruption if multiple processes/sessions write concurrently.
TS location
packages/agent-sdk-ts/src/sdk/runtime/persistence.ts (FileStore)
Python reference
openhands-sdk/openhands/sdk/conversation/persistence_const.py
openhands-sdk/openhands/sdk/conversation/fifo_lock.py
openhands-sdk/openhands/sdk/conversation/serialization_diff.py
openhands-sdk/openhands/sdk/conversation/event_store.py
Implementation plan
- Add a lock abstraction for filesystem persistence (cross-process).
- Decide on file layout: keep JSONL or adopt per-event files; document invariants.
- Port minimal diffing utilities for state snapshots.
- Add tests (concurrent writers).
Acceptance criteria
- Concurrent LocalConversation sessions cannot corrupt persistence files.
agent-sdk-ts is basically a transpilation of the original python SDK that we can find at enyst/agent-sdk (it’s a fork for our use). Clone yourself agent-sdk so you have the original codebase and you can understand the code deeply before transpiling.
Gap
Python persistence is multi-process safe (FIFO locks) and has defined constants + diffing utilities. TS
FileStoreappends toevents.jsonlwith no locking, making it vulnerable to corruption if multiple processes/sessions write concurrently.TS location
packages/agent-sdk-ts/src/sdk/runtime/persistence.ts(FileStore)Python reference
openhands-sdk/openhands/sdk/conversation/persistence_const.pyopenhands-sdk/openhands/sdk/conversation/fifo_lock.pyopenhands-sdk/openhands/sdk/conversation/serialization_diff.pyopenhands-sdk/openhands/sdk/conversation/event_store.pyImplementation plan
Acceptance criteria