[Bug] Malformed tool invocation tags cause silent parser failures in multi-step sessions
Bug Description
Bug: the model intermittently emits a malformed tool-call opening tag, so the call is never executed.
Symptom. Roughly every other tool call (especially Bash/Read/Edit and MCP tools) comes out in a non-executable form. To the user this looks like the model "hanging" or "erroring again" — it appears to stall, when in fact the call was malformed and silently dropped by the parser.
Exact defect. Instead of the correct form
<invoke name="ToolName">
<parameter name="...">value</parameter>
</invoke>
the model emits a literal token court on its own line, followed by <invoke name="ToolName"> and <parameter ...> without the antml: namespace prefix. That block doesn't parse, so the tool is never invoked and no result comes back.
Conditions. Reproduces in long, multi-step sessions, more often after large reasoning blocks. It interleaves with correct calls to the same tool in the same session (i.e. it's intermittent, not 100%). The first call in a turn is sometimes correct; later ones in the same turn fail.
Self-correction doesn't stick. Even after explicitly intending to "use antml:invoke strictly," apologizing, and writing the rule to memory, the defect recurs on the very next call. This looks like a decoding/tool-call-templating issue rather than the model "not knowing" the format.
Impact. Breaks flow, costs the user turns on "are you stuck?", and makes long tool-heavy tasks nearly unusable.
Environment. Claude Code CLI, model Opus 4.8, a session with heavy Bash/Read/Edit and MCP (LangSmith) usage. The defect got worse toward the end of a long session.
Environment Info
- Platform: linux
- Terminal: tmux
- Version: 2.1.162
- Feedback ID: c039257e-28ca-4b2c-aa53-f581aa32e7c0
Errors
[]This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗