Skip to content

fix(desktop): preserve Windows PATH for ACP probes#2420

Open
11w5 wants to merge 1 commit into
block:mainfrom
11w5:agent/fix-windows-agent-harness-launches
Open

fix(desktop): preserve Windows PATH for ACP probes#2420
11w5 wants to merge 1 commit into
block:mainfrom
11w5:agent/fix-windows-agent-harness-launches

Conversation

@11w5

@11w5 11w5 commented Jul 22, 2026

Copy link
Copy Markdown

What this fixes

On Windows, Buzz can find a current codex-acp.cmd installation and still report it as outdated. The adapter is present; the version probe is what fails.

The failure comes from how the child PATH is assembled. Windows intentionally skips the Git Bash login-shell PATH because it is POSIX-shaped and unsafe for native processes. Buzz then builds an augmented PATH from its managed directories and executable directory. Because that value is set explicitly on the child, it replaces the desktop process's native PATH—including the directory containing node.exe.

That leaves an npm shim in an awkward state: Buzz resolves codex-acp.cmd successfully, but the shim cannot start Node. The failed --version probe is then interpreted as an outdated adapter.

Closes #2342.

What changed

  • Preserve the inherited native PATH on Windows, after Buzz-managed entries so existing precedence is unchanged.
  • Apply the same PATH composition to readiness/version probes and the managed harness process. This keeps the adapter runnable after onboarding, rather than fixing detection only.
  • Remove the auth command's one-off Windows PATH workaround and use the shared path builder instead.
  • Add regression coverage for the ordering contract: Buzz-managed paths first, inherited Node/system paths afterward.

The behavior on macOS and Linux is unchanged; those platforms continue to use the login-shell PATH.

Scope and related work

I kept this PR deliberately focused on the missing-runtime PATH that causes the false "outdated" result. The broader Windows installer and hidden-console work is already being handled in #2247, with additional harness child console suppression in #2416. This PR does not duplicate those changes.

Validation

  • just desktop-tauri-fmt-check
  • Exact PATH module tests: 6 passed
  • Windows-target compile of the changed PATH module
  • Windows-built smoke check using an npm-style .cmd shim that invokes bare node.exe through the composed PATH
  • Pre-push desktop checks: 3,401 tests passed; Biome and desktop file/text guards passed
  • Pre-push root Rust tests passed

The complete pre-push hook could not finish in this WSL environment: Flutter is not installed, and the Tauri test build requires the system ALSA development package. A full local Windows Tauri cross-check also stops in the unrelated native Opus build. GitHub CI should provide the complete supported build matrix.

Checklist

  • just ci passes locally (environment blockers described above)
  • Integration tests pass (not applicable; no relay, database, or auth protocol behavior changed)
  • New public APIs / tools / endpoints are documented (none added)
  • No new unwrap() in production code paths
  • No new unsafe blocks

Signed-off-by: 11w5 <sloan@wombleco.com>
@11w5
11w5 force-pushed the agent/fix-windows-agent-harness-launches branch from cbecbd2 to d645dba Compare July 22, 2026 21:21
@11w5
11w5 marked this pull request as ready for review July 22, 2026 21:27
@11w5
11w5 requested a review from a team as a code owner July 22, 2026 21:27
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. [Bug] Windows: Codex ACP setup reports a current adapter as outdated

1 participant