Skip to content

fix: harden Windows runtime path resolution - #2439

Open
punksterlabs wants to merge 1 commit into
garrytan:mainfrom
punksterlabs:fix/windows-browse-startup-hardening
Open

fix: harden Windows runtime path resolution#2439
punksterlabs wants to merge 1 commit into
garrytan:mainfrom
punksterlabs:fix/windows-browse-startup-hardening

Conversation

@punksterlabs

Copy link
Copy Markdown

Summary

  • let the compiled Windows browse.exe start from the shipped adjacent server-node.mjs without requiring browse/src/server.ts
  • generate shell runtime paths correctly for both $GSTACK_ROOT-backed hosts and ~-backed hosts
  • keep nested build steps in the active Bash process so Git Bash builds cannot accidentally jump into WSL
  • make generator/profile assertions portable across Windows path separators

Why

Codex installs use a minimal runtime root. On Windows that root intentionally ships the compiled browser CLI and server-node.mjs, but not the TypeScript source tree. The CLI resolved server.ts eagerly before selecting the Windows Node bundle, so a valid minimal install could fail with a missing-source/binary-setup error.

Generated setup blocks also prefixed $HOME onto env-var-backed runtime roots, and nested bash lookups could resolve to Windows' WSL launcher even when the outer build was already running in Git Bash.

Validation

  • bun run build from Git for Windows Bash
  • bun run scripts/gen-skill-docs.ts --host all --dry-run
  • bun test browse/test/config.test.ts browse/test/build.test.ts test/resolver-runtime-paths.test.ts test/gen-skill-docs.test.ts — 449 passed, 0 failed
  • git diff --check

The broader Windows suite still contains unrelated Unix-environment assumptions in migration/Codex probe tests; upstream Linux CI remains the authoritative full-suite check.

@trunk-io

trunk-io Bot commented Aug 2, 2026

Copy link
Copy Markdown

Merging to main in this repository is managed by Trunk.

  • To merge this pull request, check the box to the left or comment /trunk merge below.

After your PR is submitted to the merge queue, this comment will be automatically updated with its status. If the PR fails, failure details will also be posted here

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.

1 participant