Instead of saving an additional interrupt checkpoint, make child graphs keep a single checkpoint for each parent checkpoint

- while the inner graph makes progress it overwrites the partial progress checkpoints, eventually keeping only one for each outer step
- implement parent_config in MemorySaver
- fix edge cases in PregelLoop
This commit is contained in:
Nuno Campos
2024-07-22 16:32:15 -07:00
parent 42174ad9fb
commit 98a962661b
7 changed files with 73 additions and 48 deletions
+2 -1
View File
@@ -85,7 +85,7 @@ class MemorySaverAssertCheckpointMetadata(MemorySaver):
configurable = config["configurable"].copy()
# remove thread_ts to make testing simpler
configurable.pop("thread_ts", None)
thread_ts = configurable.pop("thread_ts", None)
self.storage[config["configurable"]["thread_id"]].update(
{
@@ -93,6 +93,7 @@ class MemorySaverAssertCheckpointMetadata(MemorySaver):
self.serde.dumps(checkpoint),
# merge configurable fields and metadata
self.serde.dumps({**configurable, **metadata}),
thread_ts,
)
}
)