fix(agent): reject malformed tool call arguments - #61784
Merged
Merged
Conversation
teknium1
force-pushed
the
fix/reject-malformed-tool-args
branch
from
July 10, 2026 03:31
7f470f7 to
890bbf5
Compare
teknium1
force-pushed
the
fix/reject-malformed-tool-args
branch
from
July 10, 2026 03:43
890bbf5 to
04e5766
Compare
santhreal
pushed a commit
to santhreal/hermes-agent
that referenced
this pull request
Jul 13, 2026
* fix(agent): reject malformed tool call arguments * test(agent): expect malformed tool arguments to fail closed
justemu
pushed a commit
to justemu/hermes-agent
that referenced
this pull request
Jul 18, 2026
* fix(agent): reject malformed tool call arguments * test(agent): expect malformed tool arguments to fail closed
Gravezzz
pushed a commit
to Gravezzz/hermes-agent
that referenced
this pull request
Jul 21, 2026
* fix(agent): reject malformed tool call arguments * test(agent): expect malformed tool arguments to fail closed
leewenjie
pushed a commit
to leewenjie/hermes-agent
that referenced
this pull request
Aug 7, 2026
* fix(agent): reject malformed tool call arguments * test(agent): expect malformed tool arguments to fail closed
randlee
pushed a commit
to randlee/hermes-agent
that referenced
this pull request
Aug 11, 2026
* fix(agent): reject malformed tool call arguments * test(agent): expect malformed tool arguments to fail closed
melon-xf
added a commit
to melon-xf/hermes-agent
that referenced
this pull request
Sep 3, 2026
* fix(agent): reject malformed tool call arguments * test(agent): expect malformed tool arguments to fail closed
teknium1
added a commit
that referenced
this pull request
Sep 19, 2026
Some OpenAI-compatible gateways emit `arguments: ""` (or whitespace) for a tool whose schema has no required parameters. On the tool_search bridge path (`normalize_tool_call_entries`) that string went straight into json.loads and every attempt failed with "arguments is not valid JSON: Expecting value ...", so the model retried the same call forever and the tool never ran (#83937). Treat a blank string like the already-accepted `None`: it means {}. The outer-loop already does this for the top-level tool_call arguments string (turn_tool_validation), so the bridge was the only surface left rejecting the shape; a tool with required params still gets the proper "missing required" hint from validate_deferred_call_args, and malformed non-blank JSON keeps failing closed (#61784 intent intact). Co-authored-by: webtecnica <webtecnica@gmail.com>
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
Malformed, scalar, array, empty, and truncated tool arguments now produce one error result without executing, while valid siblings continue.
Changes
Validation
10 targeted tests + 9 guardrail regressions passed.
Infographic