plannotator icon indicating copy to clipboard operation
plannotator copied to clipboard

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

Open backnotprop opened this issue 2 months ago • 1 comments

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.

backnotprop avatar Sep 11 '26 00:09 backnotprop

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.

modelpath-dev avatar Sep 11 '26 11:09 modelpath-dev