Files
hermes-agent/tools
teknium1 462c1c14dd fix(tools): tool_call bridge treats blank arguments as no arguments
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>
2026-09-19 10:03:11 -07:00
..