Repository navigation
fix(agent): run next_turn_params only for calls whose tool body succeeded - #41
Merged
alexb-openrouter merged 2 commits intoNov 30, 2026
Merged
Conversation
…eded A call whose arguments failed input_schema validation, or whose execute raised, still ran its next_turn_params callbacks and could change the next request. Only add a call to executed_calls when its result has no error, matching hook-blocked and invalid-JSON calls, which were already skipped. Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
I'll fix CI failures and address comments from users with write access that start with 'Devin'.
|
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.
Summary
Ports the TypeScript SDK fix that limits
nextTurnParamsto calls whose tool body actually ran and succeeded.In the tool loop, hook-blocked and invalid-JSON calls were already skipped, but a call that failed
input_schemavalidation or whoseexecuteraised still reachedexecuted_calls. Itsnext_turn_paramscallbacks then ran with the rejected arguments and could change the next request (instructions,model,input, ...).tests/unit/test_next_turn_params_executed_calls.pycovers success (applied) and hook-blocked, schema-rejected, raised, and invalid-JSON calls (not applied). The schema-rejected and raised cases fail onmain.