Repository navigation
feat(dynaflow): DynamoDB checkpointer for run/thread state (#280) - #334
Conversation
|
Thanks @shivamm-gupta — reviewed, and the checkpointer design (closes #280) looks great. It needs a quick rebase onto latest
To rebase: git fetch upstream && git rebase upstream/development
# resolve: re-apply the checkpoint save/load around the new helper calls in run()/arun()
uv run --no-sync mypy && uv run --no-sync pytest -q
git push --force-with-leaseThe |
…orstartups#280) - Add Checkpoint data model with parent lineage tracking and lossless serialization - Define BaseCheckpointer interface with save, get, list, and put operations - Implement MemoryCheckpointer for offline execution, debugging, and testing - Implement DynamoDBCheckpointer keyed by thread_id and checkpoint_id with thread manifests - Wire checkpointer into ReActAgent to record state after each step and support time-travel resumption - Add comprehensive moto-based test suite in tests/test_checkpointer.py
3e0b7bb to
ebf349f
Compare
|
Rebased onto latest \upstream/development! Integrated the checkpoint save/load logic around the new _process_tool_calls\ and _finalize_result\ helpers in both |
Description
Closes #280
Implements persistent run and thread state checkpointing for agent orchestration (dynaflow pillar), enabling long-running and human-in-the-loop workflows to survive restarts and support deterministic time-travel resumption.
Changes
Core Checkpointing Abstractions:
Checkpointdata model withthread_id,checkpoint_id,parent_checkpoint_idlineage tracking, execution step numbers, node identifiers, state dictionaries, metadata, and ISO timestamps.BaseCheckpointerabstract contract providingsave(),get(),list(), and convenientput()operations.In-Memory Checkpointer:
MemoryCheckpointerwith thread-safe lock management for local development, rapid unit testing, and ephemeral agent executions.DynamoDB-Backed Checkpointer:
DynamoDBCheckpointeraligned with dynavec's single-table schema:pk = "{namespace}#checkpoint#{thread_id}#{checkpoint_id}"pk = "{namespace}#thread#{thread_id}"maintaining pointers to latest checkpoint and chronological history._to_dynamoand_from_dynamo.Engine and Agent Integration:
BaseCheckpointerintoReActAgent(__init__,run,arun).resume_fromor existingthread_id) restoring messages, prior steps, and tool execution counts.Verification
tests/test_checkpointer.pycovering:MemoryCheckpointerCRUD and time-travel lookupsReActAgentstep-by-step checkpointing and interrupted thread resumptionpytest tests/test_agents.py tests/test_checkpointer.py(14 passed).ruff checkandruff format.