fix(acp): parse <tool_use> XML tags from Copilot ACP long_context mode - #45231
EdderTalmor wants to merge 2 commits into
Conversation
- tui_gateway/slash_worker.py: Set HERMES_SLASH_WORKER=1 for non-interactive subprocess - cli.py: Auto-approve destructive slash commands when HERMES_SLASH_WORKER=1 - hermes_cli/web_server.py: Add gateway config cache (30s TTL) and status response cache (5s TTL) - web/src/hooks/useSidebarStatus.ts: Reduce polling from 10s to 30s - web/src/pages/SessionsPage.tsx: Reduce polling from 5s to 15s, remove duplicate status fetch - tests/hermes_cli/test_destructive_slash_confirm_gate.py: Add test coverage for slash worker auto-approval - hermes_cli/web_server.py: Bypass caches during pytest runs (PYTEST_CURRENT_TEST)
When Copilot ACP is run with --context long_context, the model emits
Anthropic/Claude native <tool_use> XML tags instead of Hermes'
expected format. This commit adds regex parsing for both self-closing
<tool_use name=... arguments=... id=... /> and opening/closing
<tool_use>{JSON}</tool_use> formats.
Fixes NousResearch#45139
|
Verified clean — bundled PR with multiple concerns. Reviewed 4 distinct changes in this PR:
No issues found. |
|
Thanks for targeting a verified Copilot ACP regression. Current main still only extracts Problems
Suggested changes
Automated hermes-sweeper review. |
Summary
When Copilot ACP is invoked with
--context long_context, the model emitsAnthropic/Claude native
<tool_use>XML tags instead of Hermes' expected0xNformat. This commit adds regex parsing for both self-closing<tool_use name="..." arguments="..." id="..." />and opening/closing<tool_use>{JSON}</tool_use>formats.Changes
_TOOL_USE_XML_REregex pattern to match<tool_use>XML tags_extract_tool_calls_from_text()to parse<tool_use>tags<tool_use>formatsTesting
inputattribute<tool_use>and Hermes XML formatsFixes #45139