Edit(2026-04-24T15:57Z):
The bug #2163 has been partially fixed in v0.0.21, but the bug still occurs if opencode is a .cmd.
I have updated the pull request and commented below for the latest change at: https://github.com/pingdotgg/t3code/pull/2183#issuecomment-4281104184
Edit(2026-04-28T14:07Z):
ssswagatss commented that they were affected by #2163.
What Changed#
This fixes #2163.
- Fix resolving
opencode path on Windows by using where.exe (similar as which on macOS and Linux).
- Spawn
opencode with shell on Windows.
Why#
- Fix resolving
opencode as it could not be found on Windows.
- Spawn
opencode with shell on Windows because opencode may be a .cmd shim (e.g. with npm i -g opencode-ai)
Checklist#
Manual Testing#
Tested the two opencode installations from https://opencode.ai/download that are possible for Windows.
npm i -g opencode-ai
where.exe opencode
# C:\Program Files\nodejs\opencode
# C:\Program Files\nodejs\opencode.cmd
bun add -g opencode-ai
where.exe opencode
# C:\Users\adam\.bun\bin\opencode.exe
Before:

After:

Tests#
Extended "resolves command names through PATH" to handle resolving the opencode on Windows using where.exe.
Validation#
Thanks#
Thanks to @timm-u for his suggested fixes and to @IuriGuerreiro for filing the bug.
Note
Low Risk
Small, platform-gated change to process spawning; risk is limited to Windows runtime behavior when launching the OpenCode server.
Overview
Fixes spawning the local OpenCode serve process on Windows by enabling shell execution in startOpenCodeServerProcess, allowing .cmd/PATH-resolved shims to run correctly.
Non-Windows behavior is unchanged (still detached process groups), but Windows now relies on shell spawning to avoid “command not found” issues.
Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit d5b5eaeb607d4a57be4c0628e5583d0157e022d6. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).
Note
[!NOTE]
Fix opencode not found on PATH when spawning server process on Windows#
On Windows, executables resolved via PATH require spawning through a shell. Sets shell: true when calling ChildProcess.make for the serve command on Windows, and explicitly false on other platforms, in opencodeRuntime.ts.
Macroscope summarized d5b5eae.
>
Important
Review skipped#
Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
.coderabbit.yamlfile in this repository. To trigger a single review, invoke the@coderabbitai reviewcommand.⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID:
da8b7faa-cda3-4af3-bc6e-5eb6dbeee391You can disable this status message by setting the
reviews.review_statustofalsein the CodeRabbit configuration file.Use the checkbox below for a quick retry:
✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share