Skip to content

Calls to an unknown tool are reported as completed (ACP status "completed") #54238

Description

@sishuaigong

Description

If the model calls a tool OpenCode doesn't have, experimental_repairToolCall
(packages/opencode/src/session/llm.ts) sends the call to the invalid tool.
That tool returns the error with Effect.succeed
(packages/opencode/src/tool/invalid.ts), so the part ends as completed.

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_update with status: "completed" (in
Zed it shows as a succeeded step titled "Invalid Tool"), and the part is
stored as completed. Other tool failures (e.g. read on 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.ts is unchanged on dev.

Steps to reproduce

  1. Run opencode acp from an ACP client (e.g. Zed), with a model that calls
    a tool name OpenCode doesn't offer (e.g. write_file). We used a scripted
    OpenAI-compatible endpoint that returns that call.
  2. Look at the tool_call_update for that call: its status is completed.
  3. For comparison, a read of a missing file reports failed.

Screenshot and/or share link

No response

Operating System

Linux (Ubuntu VM)

Terminal

No response

Activity

  1. opencode-agent commented on Oct 10, 2026

    @opencode-agent
    Contributor

    Thanks 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 completed status is unlikely to be fixed in v1.

    v2 (@opencode/cli) handles this differently. It doesn't send unknown tool calls to an invalid tool. 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:

    If you think this is critical, or you see the same behaviour on v2, please reply here with the details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions