[BUG] Opus 4.8 (1M) intermittently emits tool calls as legacy <invoke> XML (dropped antml: prefix) instead of structured tool_use — self-reinforcing in long non-ASCII sessions

Open 💬 0 comments Opened Jun 28, 2026 by prochoim

Summary

On claude-opus-4-8[1m], tool-call turns intermittently fail with "Your tool call was malformed and could not be parsed. Please retry." On a stop_reason: tool_use turn, the model serializes the call as legacy <invoke name="..."> XML text with a dropped antml: prefix instead of a structured tool_use block, so the parser rejects it; the accompanying text is discarded and the turn stalls until the user re-prompts manually.

In one long session today I hit this at least 15 times. Same failure mode as #64235 / #63604 / #64658, plus an additional reproducible-pattern data point below.

Environment

  • Model: claude-opus-4-8[1m] (1M context)
  • Claude Code: 2.1.195
  • Effort: xhigh
  • OS: macOS
  • Language: Korean (2-byte / non-ASCII), heavy
  • Session: very long, high tool / MCP density

Symptom

  • stop_reason: tool_use but no tool_use block (thinking/text only).
  • Harness injects: Your tool call was malformed and could not be parsed. Please retry.
  • The malformed payload leaks as visible text shaped like call + <invoke name="Bash">… — i.e. the antml: namespace prefix is dropped (matches the root-cause analysis in #64658).
  • When it leaks into a final message and isn't retried, the turn "goes silent" and the user must re-prompt by hand.

New data point — self-reinforcing, and call shape correlates

Within a single session it degraded over time, consistent with context accumulation:

  • Early in the session: dozens of consecutive tool calls succeeded.
  • After the first malformed <invoke> leaked into the transcript, subsequent calls failed far more often — as if the leaked legacy-XML pattern in context biases the model toward repeating it.
  • Call shape mattered empirically: short calls with a 1–2 word lead-in usually succeeded; large Write/Edit payloads, or calls preceded by a paragraph of descriptive prose, failed far more often (consistent with #63875's "longer turns / special-character arguments").

Regression

Reported fixed by reverting to claude-opus-4-7[1m] with identical context (#63604); 4.7 does not reproduce.

Reproduction

Not deterministic. Reliably worsens under: 1M context + xhigh effort + long session + 2-byte characters + high tool density (the same conditions cited across the related issues).

Impact

At least 15 failed tool calls in one session, each aborting the in-progress action and requiring a manual re-prompt; work is effectively blocked once the session tips into the failure mode.

Request

  1. Prioritize the Opus 4.8 tool_use serialization fix (the legacy <invoke> / dropped-antml:-prefix path).
  2. Interim resilience: when the tool_use block is malformed, still deliver the accompanying text block so the model can at least communicate (per #63604).

Related

#64235, #63604, #64658, #61133, #63875, #62123

View original on GitHub ↗