Skip to content

fix: normalize local tool JSON fallbacks#37229

Open
scubamount wants to merge 1 commit into
NousResearch:mainfrom
scubamount:feat/local-tool-json-fallback
Open

fix: normalize local tool JSON fallbacks#37229
scubamount wants to merge 1 commit into
NousResearch:mainfrom
scubamount:feat/local-tool-json-fallback

Conversation

@scubamount
Copy link
Copy Markdown

Summary

  • normalize local-model assistant JSON with commands/tools_used into OpenAI-style tool calls
  • support direct argument fields as well as nested arguments objects
  • allow execute_code(command=...) compatibility by wrapping shell commands into Python subprocess code while preserving code= precedence

Tests

  • PYTHONPATH=/Users/andrew/.hermes/hermes-agent /opt/homebrew/opt/python@3.12/libexec/bin/python3 -m pytest -o addopts='' tests/agent/transports/test_chat_completions.py tests/tools/test_code_execution.py -q
  • 141 passed in 98.56s

@scubamount
Copy link
Copy Markdown
Author

Cross-ref: this PR is the client-side counterpart to jundot/omlx#1596 (feat: add Hermes tool call parser).

These two PRs are co-dependent:

  • hermes-agent#37229 (this PR): normalizes local-model assistant JSON with commands/tools_used into OpenAI-style tool calls on the hermes-agent side.
  • omlx#1596: parses Hermes-style <|tool_call_start|>...<|tool_call_end|> markers at the OMLX inference server layer, returning structured tool calls instead of raw marker text.

Without both, local model tool calling is broken:

  • Without hermes-agent#37229 → hermes-agent cannot normalize mixed JSON/bracket payloads from local models
  • Without omlx#1596 → OMLX leaks raw Hermes markers that hermes-agent cannot parse

Both should merge together for a complete fix.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder tool/code-exec execute_code sandbox labels Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists tool/code-exec execute_code sandbox type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants