Skip to content

opencode provider: unhelpful ENOENT when the opencode CLI is not on PATH #1503

Closed

Description

@backnotprop

Follow-up from #856. The attach path was removed in #1445, but createOpencodeServer() in packages/ai/providers/opencode-sdk.ts (~:93-98) has no try/catch around the spawn: when the opencode CLI is missing, the raw uv_spawn ENOENT propagates through ensureServer()'s rethrow with no PATH probe and no actionable hint. Wrap the spawn and surface a clear message ('opencode CLI not found on PATH - install it or disable the opencode provider'), ~10 lines. Reported shape: Windows, Ask AI with the opencode provider selected.

Activity

  1. modelpath-dev commented on Sep 11, 2026

    @modelpath-dev

    I will take this issue. Please assign it to me.

    The problem is in createOpencodeServer() within opencode-sdk.ts. The function does not handle the case where the opencode CLI is missing from the PATH. I would first add a try/catch block around the spawn call. This would allow us to catch the ENOENT error and provide a clearer message to the user. I will ensure the message suggests installing the CLI or disabling the provider. This should improve the user experience on Windows when the CLI is not found.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions