[PR #6864] fix(langgraph): correct ParentCommand bubbling when checkpoint_ns includes numeric task segments #5355

Open
opened 2026-02-20 17:51:35 -05:00 by yindo · 0 comments
Owner

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

State: open
Merged: No


Fixes incorrect Command.PARENT bubbling when checkpoint namespaces include numeric task-disambiguation segments like |1. In some nested-invoke/fanout scenarios, the runtime inserts a purely-numeric namespace segment between name:task_id segments (e.g. parent_first:<id>|1|node:<id>). The previous ParentCommand rewrite logic only handled numeric segments at the end of the namespace, which could produce a malformed parent graph identifier (e.g. parent_first:<id>|1) and prevent the command from routing to the intended parent node.

This change normalizes checkpoint namespaces by dropping numeric segments before computing the parent namespace in both sync and async retry paths. Added a minimal regression test that exercises the nested-invoke case and asserts that Command(graph=Command.PARENT, goto=...) reliably routes to the parent graph, regardless of whether the jump comes from the first or second nested invocation.

**Original Pull Request:** https://github.com/langchain-ai/langgraph/pull/6864 **State:** open **Merged:** No --- Fixes incorrect `Command.PARENT` bubbling when checkpoint namespaces include numeric task-disambiguation segments like `|1`. In some nested-invoke/fanout scenarios, the runtime inserts a purely-numeric namespace segment between `name:task_id` segments (e.g. `parent_first:<id>|1|node:<id>`). The previous ParentCommand rewrite logic only handled numeric segments at the end of the namespace, which could produce a malformed parent graph identifier (e.g. `parent_first:<id>|1`) and prevent the command from routing to the intended parent node. This change normalizes checkpoint namespaces by dropping numeric segments before computing the parent namespace in both sync and async retry paths. Added a minimal regression test that exercises the nested-invoke case and asserts that `Command(graph=Command.PARENT, goto=...)` reliably routes to the parent graph, regardless of whether the jump comes from the first or second nested invocation.
yindo added the pull-request label 2026-02-20 17:51:35 -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#5355