Skip to content

e2e/stamp.test.ts gives the service a POSIX-only PATH — service-hosted stamp test can never pass on Windows (and no CI job runs e2e there) #148

Closed

Description

@WhollyMindless

makeServeGuest hands the spawned service a hard-coded POSIX PATH (e2e/stamp.test.ts:103):

PATH: `${dirname(process.execPath)}:/usr/bin:/bin:/usr/sbin:/sbin`,

On Linux the service's plugin finds /usr/bin/git, resolveRepo reads git remote get-url origin, and the row stamps with the origin-URL key the test expects (line 238). On Windows those four directories don't exist and the bun dir holds no git.exe, so the service's git call silently fails and resolveRepo falls back to the path-hash key (src/repokey.ts:84-86). The test process still has the real Windows PATH, so fixture setup itself succeeds (git init + git remote add origin, lines 98-99) — which makes the mismatch guaranteed:

Expected to contain: "repo=8960c7c730bb"
Received: "... repo=210edb5f49fd repoPath=C:\...\osi-serve-XXXX\proj"

Note the repoPath IS the session's project — the plugin resolved the session location correctly (#90's actual contract holds on Windows); only the key derivation diverged because the sandboxed service couldn't spawn git.

Why CI never sees it: test:e2e runs only in the ubuntu-only smoke job (ci.yml:63-84), and test-windows runs bun run test = bun test ./test/, which excludes ./e2e/. So this test currently executes on Windows nowhere — but every Windows contributor runs it locally via bare bun test (Bun's default pattern includes e2e/) and sees an unexplained red.

Suggested fix — platform-aware PATH for the fixture (sandbox isolation of HOME/XDG stays intact; this only widens executable lookup):

PATH: process.platform === "win32"
  ? `${dirname(process.execPath)};${process.env.PATH}`
  : `${dirname(process.execPath)}:/usr/bin:/bin:/usr/sbin:/sbin`,

Arguing against the tempting alternative: test.skipIf(win32) would be the wrong fix here. This test pins a platform-neutral contract (a service-hosted session stamps its own repo, not the service launch dir), and since no CI job runs e2e on Windows, a platform skip would mean it never runs on Windows anywhere, ever — hiding real #90-class regressions from the one environment where they were historically observed. Fixing the PATH keeps (and actually starts) Windows coverage of this contract.

Repro: Windows machine with git installed, repo deps installed, Bun 1.4.4 (the CI pin): bun test ./e2e/ --timeout 240000 → the scenario fails with a path-hash repo= where the URL hash is expected; same tree on Linux is green.

Activity

  1. WhollyMindless commented on Oct 28, 2026

    @WhollyMindless
    ContributorAuthor

    Taking this one — same branch as #147 (fix/test-windows-147-148): the makeServeGuest PATH becomes platform-aware exactly as suggested (bun dir + the real process.env.PATH on win32, POSIX dirs elsewhere), so the sandboxed service can spawn git and resolveRepo derives the same origin-URL key the test asserts. HOME/XDG sandbox isolation untouched; executable lookup only.

    Agreed on skipping being the wrong fix — this pins a platform-neutral #90-class contract, and with no Windows e2e CI job, a skip would delete Windows coverage rather than start it. Verified red here on Windows/Bun 1.4.4 (path-hash key where the URL key is expected) before touching anything; CI legs untouched.

  2. added a commit that references this issue on Oct 28, 2026
  3. abogartz-opencode-self-improvement commented on Oct 28, 2026

    @abogartz-opencode-self-improvement

    🎉 This issue has been resolved in version 0.14.16 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions