Repository navigation
fix(conversation): distinguish invalid tool-call arguments - #6237
Draft
yuhengcai1 wants to merge 1 commit into
Draft
yuhengcai1 wants to merge 1 commit into
yuhengcai1 wants to merge 1 commit into
Conversation
Co-authored-by: openhands <openhands@all-hands.dev>
This was referenced Oct 26, 2026
Contributor
|
📁 PR Artifacts Notice This PR contains a |
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.
HUMAN:
AGENT:
Why
When tool validation fails,
Agent._emit_tool_error()emits anActionEventwithaction=Noneand retains the original tool call. The stuck detector compares only the absent action, tool name, and narration, so distinct invalid argument values are treated as repeated identical calls. It can tell the agent that it used the same arguments three times and stop it after the fourth attempt even though each attempt changed the arguments.Summary
Conversation.run()and retain repeated-invalid-call positive controls.Documentation: OpenHands/docs#1009
Issue Number
No existing issue identified for this defect. This branch starts directly from main and is independent of the narrative-thought change in #6235 and threshold fix in #6236.
How to Test
On main
ce5716a3c0a955a85bb0cc4dcfaa94d5fefcda50, native calls with valid JSON but invalid command types (0,1,2,3instead of a string) incorrectly endSTUCK: 1 failed, 4 passed in the nudge suite. With the fix, the four distinct attempts consume the scripted final message and finish with no corrective nudge. Repeating the same invalid value still nudges and stops. All 17 related Python tests pass.The TypeScript changing-arguments case also fails on base (1 failed, 18 passed before adding the missing-raw-data control). With the fix, all 20 detector tests and 399 tests across the full 27-file suite pass. Build, formatting, and pre-commit checks pass; ESLint has 0 errors and 5 existing warnings outside changed files.
Additional native controls pass: pause after two failures and resume without a new user message retains the streak (one nudge, stop after four total failures); inserting a new user message resets it (no nudge, normal finish); four distinct failing calls in a single LLM response do not trigger a repetition stop.
Runtime: macOS arm64, Python 3.13.17, Node 24.19.0, committed lockfiles. Python tests use
TestLLMto supply messages and the realAgent, validation, events, and run loop. No paid inference or real-model benchmark was run. TypeScript's full suite needs localhost ports for temporary test fixtures.Video/Screenshots
Non-visual fix; reproducible test commands and before/after outcomes are above.
Design Doc
Small comparison correction; no separate design document.
Type
Notes
The fallback compares retained argument strings exactly. It does not parse or repair invalid arguments, change validation, or redefine equality for executable actions. Thresholds, observation matching, and serialized events are unchanged.
The HUMAN section remains for the contributor. Please apply
integration-testfor agent-behavior evaluation; this contributor account lacks permission to add labels.