packages/opencode/src/session/llm.ts:296 — present on dev, v1.17.7, and v1.18.21.
experimental_repairToolCall's fallback rewrites any unrepairable call to the client-side invalid tool. For a provider-executed call that is the wrong move twice over: the call wasn't a hallucinated name, and the rewrite mutates the assistant message. Anthropic then rejects every subsequent request in the session, because the signed thinking sibling no longer matches the block it was signed with — one unknown tool call turns into a hard 400 for the remainder of the conversation.
We hit this via a provider bug (@ai-sdk/anthropic omits dynamic: true on tool_search_tool_*, filed separately), but the repair path is independently wrong: repair exists for the model inventing a tool name, and a providerExecuted call is by definition not that.
ai passes the raw tool call to the hook, so failed.toolCall.providerExecuted is available (ai/dist/index.mjs:3524) — declining to repair when it is set, and rethrowing instead, keeps the transcript intact.
Not the same defect as #41738; that one is about compaction.
packages/opencode/src/session/llm.ts:296— present ondev,v1.17.7, andv1.18.21.experimental_repairToolCall's fallback rewrites any unrepairable call to the client-sideinvalidtool. For a provider-executed call that is the wrong move twice over: the call wasn't a hallucinated name, and the rewrite mutates the assistant message. Anthropic then rejects every subsequent request in the session, because the signedthinkingsibling no longer matches the block it was signed with — one unknown tool call turns into a hard 400 for the remainder of the conversation.We hit this via a provider bug (
@ai-sdk/anthropicomitsdynamic: trueontool_search_tool_*, filed separately), but the repair path is independently wrong: repair exists for the model inventing a tool name, and aproviderExecutedcall is by definition not that.aipasses the raw tool call to the hook, sofailed.toolCall.providerExecutedis available (ai/dist/index.mjs:3524) — declining to repair when it is set, and rethrowing instead, keeps the transcript intact.Not the same defect as #41738; that one is about compaction.