Skip to content

fix(process): resolve opencode.exe from PATH directly when no .cmd shim exists#183

Merged
grinev merged 1 commit into
grinev:mainfrom
danieliyahu1:fix/resolve-opencode-exe-from-path
Jul 11, 2026
Merged

fix(process): resolve opencode.exe from PATH directly when no .cmd shim exists#183
grinev merged 1 commit into
grinev:mainfrom
danieliyahu1:fix/resolve-opencode-exe-from-path

Conversation

@danieliyahu1

Copy link
Copy Markdown
Contributor

Description

When opencode is installed via non-npm methods (official install script, scoop, choco, winget, manual download), only \opencode.exe\ is on PATH — no .cmd\ shim exists. The current code only searches for \opencode.cmd, so for these users it falls back to \cmd.exe /c opencode serve, which still shows a visible console window.

Fix

Added a first pass in
esolveWindowsOpencodeExe()\ that checks each PATH entry for \opencode.exe\ directly. If found, it's used directly with \windowsHide: true. Falls through to the existing .cmd\ logic as before.

Resolution order

  1. opencode.exe directly on PATH — covers install script, scoop, choco, winget, manual download
  2. opencode.cmd on PATH → derive .exe — covers npm global install (existing logic)
  3. cmd.exe /c opencode — last resort safety net

Testing

  • New test:
    esolves opencode.exe directly from PATH when no .cmd shim exists\ — isolates PATH to a temp dir with only \opencode.exe, asserts the resolved absolute exe path is returned
  • Existing tests updated and all pass (6/6)
  • Lint passes

…im exists

When opencode is installed via non-npm methods (install script, scoop,
choco, manual download), only opencode.exe is on PATH — no .cmd shim
exists. The existing code only searched for opencode.cmd, so it fell
back to cmd.exe /c opencode, which still shows a visible console window.

Fix: add a first pass that checks each PATH entry for opencode.exe
directly before falling through to the .cmd resolution logic.

Adds a test that isolates PATH to only the temp dir with opencode.exe
(no .cmd shim) and asserts the resolved exe path is returned.
@grinev grinev merged commit 0d4d31d into grinev:main Jul 11, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants