fix(prebuilt): Propagate tool_call_id to checkpoint_ns in ToolNode #6714#6722
Open
Aparnap2 wants to merge 1 commit intolangchain-ai:mainfrom
Open
fix(prebuilt): Propagate tool_call_id to checkpoint_ns in ToolNode #6714#6722Aparnap2 wants to merge 1 commit intolangchain-ai:mainfrom
Aparnap2 wants to merge 1 commit intolangchain-ai:mainfrom
Conversation
Updates the configuration passed to tools to include the tool_call_id in the checkpoint_ns, enabling correct correlation of subgraph events with parent tool calls during streaming. This fix addresses Issue langchain-ai#6714 where subgraph namespaces could not be correlated with parent tool calls. Changes: - Modified _func and _afunc methods to update checkpoint_ns before creating ToolRuntime instances - Added 4 test cases to verify checkpoint_ns propagation 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
|
This feature is blocking my production use case. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #6714
Updates
ToolNodeto include thetool_call_idin thecheckpoint_nsconfiguration when creatingToolRuntime. This ensures that events emitted by subgraphs (tools) are properly namespaced, allowing streaming UIs to correlate subgraph events with the specific tool call that triggered them.Changes
ToolNode._funcandToolNode._afuncinlibs/prebuilt/langgraph/prebuilt/tool_node.pyto append|{tool_call_id}to thecheckpoint_ns.libs/prebuilt/tests/test_tool_node.pycovering:Verification
ruff check+ruff format).