fix(cli): execute OpenCode command shims on Windows - #261
Open
Jonesxq wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
.cmdand.batshims throughComSpecon Windows, because Node'sexecFileSynccannot execute command shims directly%VAR%text remain intactThis restores OpenCode detection for npm-installed Windows users while keeping the existing timeout and native-executable behavior.
Verification
bun test packages/cli/src/lib/opencode-helpers.test.ts(25passed,10platform skips,0failed)packages/cli/src/lib/opencode-helpers.tsnpm.cmdsmoke test (returned version11.16.0)git diff --checkFull workspace typecheck and lint were not run because dependency bootstrap could not complete in this environment: Bun registry metadata resolution failed, and the npm workspace install timed out.
Fixes #255
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Restores Windows OpenCode detection for npm-installed users. Uses a safer invocation path for command shims while preserving native binary behavior and timeouts.
.cmd/.batshims throughComSpec(fallbackcmd.exe) with a single quoted/cpayload andwindowsVerbatimArguments.MAGIC_CONTEXT_OPENCODE_BINARYto prevent extra expansion and keep spaces, metacharacters, and literal%VAR%intact.Written for commit 47ca8f6. Summary will update on new commits.
Greptile Summary
This PR restores OpenCode probing for Windows command shims.
.cmdand.batpaths throughComSpec.Confidence Score: 5/5
The PR appears safe to merge, with no concrete changed-code failure identified.
Current production paths supply command shims only on Windows, and the new invocation preserves exact shim paths while retaining direct execution for native binaries.
Important Files Changed
Reviews (1): Last reviewed commit: "fix(cli): execute OpenCode command shims..." | Re-trigger Greptile