Skip to content

Windows: agent dispatch is dead on win32 (which, /bin/sh, .cmd spawns) #442

Closed

Description

@currentbits

Found while finishing #397. The Windows work in #397 hardened the boundary; it assumed a working win32 baseline that does not exist. The app window opens on Windows, but the first agent dispatch fails.

Blockers, in order of severity:

  1. electron/providers.js:559 — isBinAvailable shells out to execFileSync("which", [bin]). There is no which on Windows, so it throws, returns null, and assertProviderBinary raises "Provider binary not found" for every provider. Nothing can be dispatched. Only an absolute path in CODER_<PROVIDER>_BIN sidesteps it (that branch uses fs.existsSync).
  2. Agent CLIs install on Windows as claude.cmd / codex.cmd. Current Node refuses to spawn a .cmd without shell: true (CVE-2024-27980 fix), so fixing the lookup is not sufficient — the spawn path in runner.js needs to handle it, and doing that with shell: true reopens quoting concerns for prompts passed as argv.
  3. electron/verify.js:84 — spawn("/bin/sh", ["-c", command]). Verify commands cannot run.
  4. electron/memory-sup.js:827 — which node for the supervisor.
  5. electron/pathEnv.js:108 — env.SHELL || "/bin/zsh". Fails closed (returns null, caught) so it is not fatal, but the login-shell PATH augmentation silently never happens on Windows, which makes (1) worse.

Note a fix must respect the #397 boundary rule: for a WSL-side project the lookup belongs inside the distro, where which is correct. So this is not a blanket which→where swap — it is per side of the boundary, and electron/ssh.js wrapCommand is already the seam for that.

Also unverified: nothing in this repo has ever been run on Windows as far as the code shows. scripts/package-cross.sh builds an unsigned win32-x64 zip with no boot probe (a Windows binary cannot be smoke-tested on the Mac), so even a green CI leg would not prove the app starts. Packaging/signing is #440.

Activity

  1. added
    plan:todo
    plan:doing
    plan:done
    and removed
    plan:todo
    plan:doing
    on Aug 18, 2026
  2. currentbits commented on Aug 18, 2026

    @currentbits
    OwnerAuthor

    Merged into the #397 branch across #448/#449/#450 plus the core fix in 160e14e. Agent dispatch, the POSIX-only spots, a shared win32-safe test fake, and a CI boot job all landed. Windows behaviour itself stays unproven until the new smoke job runs on a push — that is now the single open question rather than an open-ended one. Packaging/winget remains #440.

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

    plan:done

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions