Skip to content

fix: Windows support for opencode.exe resolution, health check, WRAP_CWD - #1

Merged
veerareddyvishal144 merged 3 commits into
Fast-Editor:mainfrom
srnafi:main
Oct 15, 2026
Merged

veerareddyvishal144 merged 3 commits into
Fast-Editor:mainfrom
srnafi:main

Conversation

@srnafi

@srnafi srnafi commented Oct 14, 2026

Copy link
Copy Markdown
Contributor

Makes opencode-wrap work on Windows. Three fixes:

  1. bootstrap.rs: Use Command::new("opencode.exe") on Windows (Rust's Command doesn't consult PATHEXT, so bare "opencode" fails). Fallback path included.
  2. bootstrap.rs: Health check accepts any HTTP 200 (not just {"healthy":true} JSON) — handles serve endpoints returning HTML.
  3. config.rs: Default WRAP_CWD to %TEMP% on Windows instead of hardcoded /tmp (which doesn't exist).

Tested on Windows 10 with opencode v1.19.0 and opencode-wrap.

vishal veerareddy and others added 2 commits October 15, 2026 10:23
bootstrap.rs and config.rs were rewritten on main for the OpenCode 2 API
(/api/info health probe, basic auth, spawn credentials, validated WRAP_CWD).
Resolved by taking main's versions; the Windows fixes are re-applied on the
V2 code in the following commit.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Re-applies the intent of the original Windows commit on top of the V2 code:

- Resolve the CLI on Windows by probing PATH for opencode.exe, then the npm
  opencode.cmd / opencode.bat shims. Rust's Command already appends .exe but
  does not consult PATHEXT, so bare "opencode" misses npm installs. .cmd
  shims are run through cmd.exe by std; a warning notes that only the shim
  is killed on shutdown.
- Default WRAP_CWD to the system temp directory on Windows (always exists)
  instead of /tmp, which fails the directory check there.
- Fall back to USERPROFILE for the home-directory warning.
- Document the Windows default and the npm-shim caveat in the README.

The original health-check relaxation (accept any HTTP 200) is dropped: main
now probes /api/info and checks the JSON version, and accepting HTML would
mark an OpenCode 2 UI response as healthy.

Co-authored-by: srnafi <sezarrezanafi@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@veerareddyvishal144
veerareddyvishal144 merged commit 4ef3915 into Fast-Editor:main Oct 15, 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