mirror of
https://github.com/langchain-ai/langgraph.git
synced 2026-08-24 16:42:24 +02:00
In durability="async" mode (the default), put_writes calls are fire-and-forget coroutines — a process crash between write submission and checkpoint commit leaves a DELTA_SENTINEL blob with no backing writes, causing silent data loss on replay. AsyncPregelLoop now maintains _delta_write_futs: any write to a DeltaChannel channel appends its asyncio.Future to this list in accept_writes. _checkpointer_put_after_previous drains the list with await asyncio.gather() before calling aput(), guaranteeing checkpoint_writes are durable before the sentinel blob is committed. The sync loop is unchanged: BackgroundExecutor.__exit__ already ensures all background tasks complete before invoke() returns. Also fixes DeltaChannel(list, add_messages) constructor call in checkpoint-postgres async test (missing typ arg). Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>