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
{{ message }}
Repository navigation
repairToolCall rewrites provider-executed tool calls to "invalid", breaking the rest of the Anthropic session #45261
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.
V2 has no tool-call repair step, so provider-executed tool calls are no longer rewritten to the client-side invalid tool. Anthropic server_tool_use blocks are identified as provider-executed directly from the response and are sent back as server tool calls in later requests. To get v2: npm i -g @opencode/cli@latest or curl -fsSL https://opencode.ai/v2/install | bash (desktop: update the app). If you still see this on v2, please open a new issue with the details.
Activity
lu-zero commentedon Aug 27, 2026
#23298 apparently was never addressed and this is a symptom
neriousy commentedon Oct 19, 2026
V2 has no tool-call repair step, so provider-executed tool calls are no longer rewritten to the client-side
invalidtool. Anthropicserver_tool_useblocks are identified as provider-executed directly from the response and are sent back as server tool calls in later requests. To get v2:npm i -g @opencode/cli@latestorcurl -fsSL https://opencode.ai/v2/install | bash(desktop: update the app). If you still see this on v2, please open a new issue with the details.