# NousResearch/hermes-agent · Tool-call parsing bugs in XML and nested JSON

## Open now

- 2 issues, 2 PRs open on GitHub.
- #22696: BUG: tool_use parser fails intermittently when closing tag appears inside JSON strings
- #45139: \[Bug\]: Tool execution fails silently with Copilot ACP --context long_context (Claude outputs <tool_use>)
- PR #23888: fix(agent): replace fragile tool_call regex with brace-depth scanner for nested JSON
- PR #45231: fix(acp): parse <tool_use> XML tags from Copilot ACP long_context mode

Multiple bugs and fixes related to parsing tool calls that appear as inline XML tags or contain nested JSON, particularly affecting the Copilot ACP adapter. Issues include silent failures, regex fragility, and raw text passthrough.

## TL;DR

- 7 member(s): 2 open issue(s), 2 closed issue(s), 2 open PR(s), 0 merged PR(s), 1 PR(s) closed without merging.
- No fix has been merged to main; one or more PRs were attempted (see below).
- **Recommended:** review the prior/competing PR(s) below. A fix was attempted but not merged; your case may extend or revive that work.

## Maintainer resolution verdict

- Internal-tracker verdict over this cluster's issue members: `unresolved`. This is distinct from the fix status above. Weigh it yourself.

## How this cluster was grouped

- Link evidence (`STRUCTURAL_PARTIAL`): some members are connected by structural evidence (shared changed files, or a closing/superseded reference); the rest are joined by an automated relevance judgement over their text.
- Members outside that structural core may belong to a different underlying problem.
- Pairwise link density `0.19`: the share of member pairs that carry a link, counting a structural link in full and a relevance-only link at 0.36. `1.00` means every pair is linked.

## Open related issues

- #22696: BUG: tool_use parser fails intermittently when closing tag appears inside JSON strings
- #45139: \[Bug\]: Tool execution fails silently with Copilot ACP --context long_context (Claude outputs <tool_use>)

## Closed / duplicate issues

- #4543: \[Bug\]: Choosing GitHub Copilot ACP as a model provider breaks toolcalls
- #22688: Bug: tool_use regex parser fails with nested JSON — blocks pass through as raw text

## Prior & competing PRs

- **#23508: Recover inline XML tool calls from chat-completion content**. closed without merge
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#22696`, `#23888`
- **#23888: fix(agent): replace fragile tool_call regex with brace-depth scanner for nested JSON**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`; refs `#23508`
  - files: `agent/copilot_acp_client.py`, `tests/agent/test_copilot_acp_client.py`
- **#45231: fix(acp): parse <tool_use> XML tags from Copilot ACP long_context mode**. open
  - maintainer direction: category `uncategorized`; implication `needs_llm`
  - files: `agent/copilot_acp_client.py`, `cli.py`, `hermes_cli/web_server.py`, `tests/agent/test_copilot_acp_client.py`, `tests/hermes_cli/test_destructive_slash_confirm_gate.py`, `tui_gateway/slash_worker.py`, `web/src/hooks/useSidebarStatus.ts`, `web/src/pages/SessionsPage.tsx`

## Fix status

- No merged fix on record.
- Subsystem: `acp`
