fix: run opencode server through shell on Windows#2400
fix: run opencode server through shell on Windows#2400Loues000 wants to merge 1 commit intopingdotgg:mainfrom
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the 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. Comment |
ApprovabilityVerdict: Approved Single-line fix adding standard Windows shell spawning pattern for child process execution. This is a common, well-understood platform compatibility fix with minimal risk. You can customize Macroscope's approvability policy. Learn more. |
|
Duplicate of #2183 |
Summary
Fix OpenCode server startup on Windows when the resolved OpenCode binary is a
.cmdshim.Node cannot spawn
.cmdfiles directly withshell: false, which can make theopencode serveprocess fail withEINVALon Windows. The existing OpenCode healthcheck already usesshell: process.platform === win32for this reason.This PR applies the same Windows-only spawn behavior to the long-running OpenCode server process. Linux and macOS behavior is unchanged.
Fix
shell: process.platform === win32to theopencode servespawn options inopencodeRuntime.tsTest plan
bun fmtbun lintbun typecheckNote
Low Risk
Small, Windows-only process spawn option change; behavior on macOS/Linux is unchanged and impact is limited to OpenCode server startup.
Overview
Fixes OpenCode server startup on Windows by spawning the long-running
opencode serveprocess withshell: process.platform === "win32", matching the behavior already used for other command executions.Non-Windows platforms keep the existing spawn behavior; only the server startup path in
opencodeRuntime.tsis affected.Reviewed by Cursor Bugbot for commit b81aacc. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix OpenCode server process spawn on Windows by running through a shell
On Windows, spawning a child process without a shell can fail for certain executables. The fix sets
shell: process.platform === "win32"in the options passed toChildProcess.makeinopencodeRuntime.ts. Non-Windows behavior is unchanged.Macroscope summarized b81aacc.