fix: confirmation strategies no longer bake stale tool args#11816
Merged
Conversation
… injected args were not always correct
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
sjrl
commented
Jun 30, 2026
Comment on lines
+242
to
+243
| class TestConfirmationStrategyToolArgPrep: | ||
| def test_confirmed_dependent_tool_runs_with_fresh_state(self): |
Contributor
Author
There was a problem hiding this comment.
This is the regression test that would have previously failed without the changes in this PR
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||||||||||||||
julian-risch
approved these changes
Jun 30, 2026
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
Proposed Changes:
Fixed a bug where configuring an
Agentconfirmation strategy could make a tool run with stale arguments. HITL confirmation prepared and baked each tool's final arguments up front (injectinginputs_from_statevalues from the state at the start of the tool calling step), which defeated the per-batch argument preparation in tool execution: a tool that reads a state key written by another tool in the same step would run with the pre-step value instead of the freshly produced one. HITL confirmation now operates on the model-requested arguments and leaves state injection to tool execution, so dependent tools again receive the correct values.How did you test it?
Added new tests and updated existing ones.
Notes for the reviewer
Note: This is still technically a breaking change in addition to being a bug fix since now we only show the LLM generated args to the users of HITL. I talked with @julian-risch offline and we agreed this was okay to do for now and that if a requirement came up later of needing to see the final args we can tackle that as a new feature.
I decided to omit the entry to MIGRATION.md for now and will add a full entry on the follow up PR that will fully resolve issue https://github.com/deepset-ai/haystack-private/issues/445
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.