[Bug] Tool-use block markup intermittently corrupted with stray token prefix

Open 💬 1 comment Opened May 30, 2026 by vnod-y-shibata

Bug Description
Title: Tool-call markup intermittently corrupted ("court" prefix) → "malformed and could not be parsed"

Summary:
Tool invocations (function_calls / tool_use blocks) are intermittently emitted
with corrupted markup. The block starts with a stray token (e.g. "court")
instead of the proper function_calls opening tag, so the harness rejects it
with "Your tool call was malformed and could not be parsed."

Symptom:

  • The same tool call, retried verbatim, usually succeeds on the next attempt.
  • Affected tools observed: Edit, Write, Bash, Read (all recovered on retry).
  • No data loss — the failure happens before the tool runs.

Conditions that seem to trigger it:

  • Long sessions with large accumulated context (multiple big tasks).
  • Emitting a tool call immediately after a long natural-language response.
  • Packing multiple tool calls into a single message.

Environment:

  • Claude Code (CLI)
  • Model: Opus 4.8 (1M context), max effort
  • Long-running session

Reproducibility:

  • Intermittent / non-deterministic. No reliable repro steps.
  • Retrying the identical call typically resolves it.
  • This session's transcript is itself a live example (please inspect the

attached conversation context).

Workarounds currently used:

  • Retry the failed call.
  • Minimize preamble text before a tool call; issue one tool at a time.
  • /compact appears to reduce frequency by shrinking context.

Environment Info

  • Platform: darwin
  • Terminal: vscode
  • Version: 2.1.158
  • Feedback ID: 6b0ec702-6a20-42a7-af9a-191f3954eb42

Errors

[]

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗