[PR #6161] fix(langgraph): reuse cached writes on nested resume to prevent task re-execution #4881

Closed
opened 2026-02-20 17:50:53 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/langchain-ai/langgraph/pull/6161

State: closed
Merged: Yes


Description: fix #6050.

Root cause: In nested graphs, the first tick after resume often included a checkpoint_id, which set skip_done_tasks=False. This skipped matching pending writes and re-executed already-completed helper @task on subsequent resumes.

Change: Initialize skip_done_tasks=True when resuming inside a nested graph. Use original config[CONF] for checkpoint_id presence, and self.config[CONF] for resuming (current loop state). Added a concise comment clarifying the different config sources.

Issue: #6050

Tests:
Add regression test test_nested_graph_resume_reuses_cached_task_writes

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6161 **State:** closed **Merged:** Yes --- **Description**: fix #6050. Root cause: In nested graphs, the first tick after resume often included a checkpoint_id, which set skip_done_tasks=False. This skipped matching pending writes and re-executed already-completed helper @task on subsequent resumes. Change: Initialize skip_done_tasks=True when resuming inside a nested graph. Use original config[CONF] for checkpoint_id presence, and self.config[CONF] for resuming (current loop state). Added a concise comment clarifying the different config sources. **Issue**: #6050 **Tests**: Add regression test `test_nested_graph_resume_reuses_cached_task_writes`
yindo added the pull-request label 2026-02-20 17:50:53 -05:00
yindo closed this issue 2026-02-20 17:50:53 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langgraph#4881