Calls to an unknown tool are reported as completed (ACP status "completed") #54238
Description
Activity
opencode-agent commented
on Oct 10, 2026 on Oct 10, 2026 – with OpenCode AgentContributorMore actionsThanks for the clear report and the comparison with
read.This is about OpenCode v1 (1.18.34). v1 only gets fixes for critical bugs, such as data loss, security problems or crashes with no workaround. Here the model still gets the right error message and the session keeps going, so the wrong
completedstatus is unlikely to be fixed in v1.v2 (
@opencode/cli) handles this differently. It doesn't send unknown tool calls to aninvalidtool. The tool runtime returns an error (No tool named "…" is currently available…) and the call is published as failed (tool.unknown), so it shouldn't show up as a successful step. We'd encourage you to try v2.Related reports about the same v1 invalid-tool fallback:
- Invalid-tool fallback persists callID:"" for empty-id tool calls → every later request 400s, session permanently bricked #53499: the invalid-tool fallback stores
callID: ""for empty-id tool calls - Invalid tool-call repair drops required tool field for unnamed calls #47830 / Invalid tool-call repair drops the required
toolfield for unnamed calls #47831: the invalid tool-call repair drops thetoolfield for unnamed calls - repairToolCall rewrites provider-executed tool calls to "invalid", breaking the rest of the Anthropic session #45261:
repairToolCallrewrites provider-executed tool calls toinvalid
If you think this is critical, or you see the same behaviour on v2, please reply here with the details.
- Invalid-tool fallback persists callID:"" for empty-id tool calls → every later request 400s, session permanently bricked #53499: the invalid-tool fallback stores
Description
If the model calls a tool OpenCode doesn't have,
experimental_repairToolCall(
packages/opencode/src/session/llm.ts) sends the call to theinvalidtool.That tool returns the error with
Effect.succeed(
packages/opencode/src/tool/invalid.ts), so the part ends ascompleted.The model gets the right message ("Model tried to call unavailable tool
'write_file'. Available tools: ..."), but everything else treats the call as
a success. ACP clients get
tool_call_updatewithstatus: "completed"(inZed it shows as a succeeded step titled "Invalid Tool"), and the part is
stored as
completed. Other tool failures (e.g.readon a missing file)end as
error/failed.Expected: the call ends as an error, with the same message for the model.
Plugins
No response
OpenCode version
1.18.34 (commit 1ddb087).
invalid.tsis unchanged ondev.Steps to reproduce
opencode acpfrom an ACP client (e.g. Zed), with a model that callsa tool name OpenCode doesn't offer (e.g.
write_file). We used a scriptedOpenAI-compatible endpoint that returns that call.
tool_call_updatefor that call: its status iscompleted.readof a missing file reportsfailed.Screenshot and/or share link
No response
Operating System
Linux (Ubuntu VM)
Terminal
No response