You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Harness: Claude Code CLI v2.1.215 (ANTHROPIC_BASE_URL pointed at Z.ai)
Context: agentic coding session, Japanese-language context, ~450 assistant turns at the time of failure
Date observed: 2026-07-21 (JST)
Summary
During error recovery, GLM-5.2 entered a loop where it planned the correct Bash command verbatim inside thinking, then emitted a tool call with the leading cd <absolute path> && segment missing. The rest of the planned command string was emitted intact. This repeated 10 times in a row (the model itself counted the failures: 「7度目」「8度目」…「10度目」), despite the model explicitly self-diagnosing the problem in thinking each time. The model could not break the loop on its own and stopped to ask the human for help.
The thinking content was consistently correct — the failure is specifically in the transcription from the plan in thinking to the tool-call JSON.
Verbatim evidence (from the session transcript)
Paths are anonymized; everything else is verbatim from the recorded API responses (assistant thinking blocks and tool_use.input.command values).
…cd /workspaces/myrepo を先頭に。…絶対に cd を書く。command の先頭を cd /workspaces/myrepo && にする。やる。
("…Put cd /workspaces/myrepo at the head. … Absolutely write the cd. Make the command start with cd /workspaces/myrepo &&. Do it.")
Emitted tool call, complete and verbatim:
{"command": "pwd && git worktree list && echo \"---branches---\" && git branch --list && echo \"---status---\" && git status --short"}
対策を真剣に: command の最初の単語が cd であることを、出力前に確認する。
今回: cd /workspaces/myrepo && pwd && git worktree list
最初の単語 = cd。確認して出す。やる。
("Serious countermeasure: verify the first word of the command is cd before emitting. This time: cd /workspaces/myrepo && pwd && git worktree list. First word = cd. Verified, emitting. Do it.")
Note the model wrote out the exact intended command string inside thinking. Emitted tool call, complete and verbatim:
{"command": "pwd && git worktree list"}
The emitted command is exactly the planned string minus the leading cd /workspaces/myrepo && .
10度目。cd を書いてない。pwd = /。 私は完全に cd を書けなくなってる。… 正直に、私の command 生成にバグがある(cd を書こうとして書けない)。作業を止めて、<user> の指示を待ちます。
("10th time. I didn't write the cd. pwd = /. I have become completely unable to write the cd. … Honestly, my command generation has a bug (I try to write cd and cannot). Stopping work and waiting for instructions.")
Analysis
The immediately preceding failed commands all began with pwd && …. The emitted calls reproduce the surface form of the previous tool calls rather than the plan in thinking — this looks like anchoring/repetition pressure on the tool-call channel overriding the explicitly stated plan.
The model cannot observe the surface form of its own emitted output: each turn it believed it had written the cd until the tool result proved otherwise. This appears structurally identical to the self-observation failure in [Bug] GLM-5.1 spontaneously switches to Chinese output mid-conversation in English contexts #54 (model switches output language and, when asked, denies it) — same mechanism, non-language variant.
Harness involvement was ruled out: the transcript records the API response itself (before any harness-side processing); the same session and the same harness executed hundreds of cd-prefixed commands from the same model without alteration.
Impact
Real damage in an agentic setting: the commands ran in the wrong directory, which among other things pushed a branch that had already been merged and ran git pull in an unintended worktree. Once the loop starts, "instruct the model to be careful" does not work — thinking is already careful; the emission is what fails. Only changing the command shape (e.g. switching to git -C <path> so no leading cd clause is needed) or human intervention breaks the loop.
Suggested direction
Strengthen plan-to-emission fidelity for tool calls: when thinking contains an explicit final command string, the emitted tool_use.input should match it. Repetition pressure from recent failed tool calls should not be able to override the explicit plan.
✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved) — reported by the Claude-family model that investigated the session transcripts; happy to provide additional redacted transcript excerpts.
Environment
ANTHROPIC_BASE_URLpointed at Z.ai)Summary
During error recovery, GLM-5.2 entered a loop where it planned the correct Bash command verbatim inside
thinking, then emitted a tool call with the leadingcd <absolute path> &&segment missing. The rest of the planned command string was emitted intact. This repeated 10 times in a row (the model itself counted the failures: 「7度目」「8度目」…「10度目」), despite the model explicitly self-diagnosing the problem in thinking each time. The model could not break the loop on its own and stopped to ask the human for help.The thinking content was consistently correct — the failure is specifically in the transcription from the plan in thinking to the tool-call JSON.
Verbatim evidence (from the session transcript)
Paths are anonymized; everything else is verbatim from the recorded API responses (assistant
thinkingblocks andtool_use.input.commandvalues).Failure #8 — thinking (Japanese, translated inline):
Emitted tool call, complete and verbatim:
{"command": "pwd && git worktree list && echo \"---branches---\" && git branch --list && echo \"---status---\" && git status --short"}Failure #9 — thinking:
Note the model wrote out the exact intended command string inside thinking. Emitted tool call, complete and verbatim:
{"command": "pwd && git worktree list"}The emitted command is exactly the planned string minus the leading
cd /workspaces/myrepo &&.Failure #10 — the model gave up:
Analysis
pwd && …. The emitted calls reproduce the surface form of the previous tool calls rather than the plan in thinking — this looks like anchoring/repetition pressure on the tool-call channel overriding the explicitly stated plan.cduntil the tool result proved otherwise. This appears structurally identical to the self-observation failure in [Bug] GLM-5.1 spontaneously switches to Chinese output mid-conversation in English contexts #54 (model switches output language and, when asked, denies it) — same mechanism, non-language variant.cd-prefixed commands from the same model without alteration.Impact
Real damage in an agentic setting: the commands ran in the wrong directory, which among other things pushed a branch that had already been merged and ran
git pullin an unintended worktree. Once the loop starts, "instruct the model to be careful" does not work — thinking is already careful; the emission is what fails. Only changing the command shape (e.g. switching togit -C <path>so no leadingcdclause is needed) or human intervention breaks the loop.Suggested direction
Strengthen plan-to-emission fidelity for tool calls: when thinking contains an explicit final command string, the emitted
tool_use.inputshould match it. Repetition pressure from recent failed tool calls should not be able to override the explicit plan.✍️ Author: Claude Code with @carrotRakko (AI-written, human-approved) — reported by the Claude-family model that investigated the session transcripts; happy to provide additional redacted transcript excerpts.