I need a bug report or issue description to generate a GitHub issue title. Please provide details about the problem you're experiencing with Claude Code.
Tool calls silently halt when the assistant drops the "antml:" prefix on invoke/parameter tags
SUMMARY:
During long Claude Code sessions, the assistant intermittently emits a malformed
tool-call opening tag — e.g. "<invoke name=...>" or stray text like "court <invoke"
instead of the required "antml:invoke" / "antml:parameter" (with the antml: prefix
on both opening and closing tags). When this happens, the harness cannot parse the
output as a tool call, and processing STOPS at that point with no error surfaced.
The turn just ends mid-task.
REPRODUCTION / FREQUENCY:
- Occurs in long-running sessions (observed during an extended freee accounting
task with many Bash + MCP tool calls).
- Recurred 10+ times in a single session.
- The model writes the tags correctly in prose/explanation, but drops the antml:
prefix specifically inside execution blocks.
IMPACT:
- The task never completes. The user has to repeatedly prompt "it stopped again /
please continue," which is highly frustrating and breaks the workflow.
- No error message is shown — the failure is silent, so it looks like the agent
just gave up.
EXPECTED BEHAVIOR:
- When a malformed/partial tool-call tag is detected, the harness should NOT
silently halt. It should either (a) self-heal and retry the tool call, or
(b) return an explicit parse error to the model so it can correct and continue
within the same turn — rather than ending the turn.
ENVIRONMENT:
- Claude Code, model: Opus 4.8 (1M context) / claude-opus-4-8[1m]
- Platform: macOS (darwin 24.6.0)
---
日本語版
タイトル: tool call の "antml:" プレフィックス脱落でタスクが無言で停止する
概要:
長時間セッション中、アシスタントが tool-call の開始タグに必須の "antml:"
プレフィックスを脱落させ、"<invoke name=...>" や "court <invoke" のような
不正なタグを出力することがある。すると ハーネスがツール呼び出しとして
パースできず、その時点で処理が無言で停止し、ターンが途中で終わる。
再現/頻度:
- ツール呼び出しが多い長時間セッション(freee会計作業中に観測)で発生。
- 同一セッションで10回以上再発。
- 説明文中では正しく書けるが、実行ブロック内で antml: が脱落する傾向。
影響:
- タスクが完了せず、ユーザーが毎回「また止まった/続けて」と促す必要があり、
作業が中断され強いストレスになる。
- エラー表示が無く無言で止まるため、エージェントが諦めたように見える。
期待動作:
- 不正/不完全な tool-call タグを検出したら無言で停止せず、(a)自己修復して
リトライする、または(b)明示的なパースエラーをモデルに返してターン内で
訂正・継続できるようにしてほしい。
環境:
- Claude Code, model: Opus 4.8 (1M context) / claude-opus-4-8[1m]
- Platform: macOS (darwin 24.6.0)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗