fix: Fix appending None to a list in State when the source key is missing#10990
Merged
fix: Fix appending None to a list in State when the source key is missing#10990
None to a list in State when the source key is missing#10990Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Collaborator
Pull Request Test Coverage Report for Build 23785192769Details
💛 - Coveralls |
julian-risch
approved these changes
Mar 31, 2026
Member
julian-risch
left a comment
There was a problem hiding this comment.
Looks good to me! 👍 Explanation of what caused the issue and how we fixed is thorough. This PR unblocks the 2.27 release. Thanks for addressing the issue so quickly.
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.
Related Issues
Agentstate corrupted withNoneentries whenoutputs_to_statesource key absent from tool result #10981Proposed Changes:
Fix
ToolInvoker._merge_tool_outputssilently appendingNoneto list-typed state when a tool'soutputs_to_statesource key is absent from the tool result. This is a common scenario withPipelineToolwrapping a pipeline that has conditional branches where not all outputs are always produced even if defined inoutputs_to_state. The mapping is now skipped entirely when the source key is not present in the result dict.How did you test it?
Added a new unit test based on what was described in the issue
Notes for the reviewer
I decided not to update
merge_listssince the fix in ToolInvoker preventsNonefrom reachingmerge_lists. It's also possible thatNoneis an intended to be passed tomerge_listswhich is still allowed if the source key is present in the tool dict and the value it points to isNone.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.