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

@scubamount scubamount commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

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

  • scripts/run_tests.sh tests/agent/transports/test_chat_completions.py tests/tools/test_code_execution.py
  • 141 passed, 0 failed
  • scripts/check-windows-footguns.py agent/transports/chat_completions.py tools/code_execution_tool.py tests/agent/transports/test_chat_completions.py tests/tools/test_code_execution.py
  • No Windows footguns found

@scubamount

Copy link
Copy Markdown
Contributor 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
@scubamount scubamount force-pushed the feat/local-tool-json-fallback branch from b4ae3e6 to 132f8a1 Compare June 2, 2026 17:59
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.

2 participants