Skip to content

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

Draft
aleixrodriala wants to merge 7 commits into
block:mainfrom
aleixrodriala:fix/windows-acp-probe-path
Draft

fix(desktop): preserve Windows PATH for ACP probes#2533
aleixrodriala wants to merge 7 commits into
block:mainfrom
aleixrodriala:fix/windows-acp-probe-path

Conversation

@aleixrodriala

Copy link
Copy Markdown

Summary

  • preserve the native process PATH when login-shell PATH discovery is unavailable
  • include the same existing well-known Windows Node/npm directories used by the install-shell fix
  • add regression tests for process-PATH fallback and login-shell precedence

This is stacked on #2247 and should be reviewed as the single additional commit 06e8a5e9. Once #2247 lands, the effective diff should collapse to desktop/src-tauri/src/managed_agents/runtime/path.rs.

Root cause

#2247 fixes PATH composition for the ACP install subprocess, but runtime discovery and launched agents use managed_agents/runtime/path.rs::build_augmented_path() instead. On Windows, login_shell_path() is intentionally None, managed Node is unsupported, and the existing builder did not preserve the native process PATH or add well-known Node directories.

As a result, a correctly installed npm shim such as %APPDATA%\Buzz\node-tools\codex-acp.cmd starts but cannot resolve node.exe. Buzz then classifies the adapter as outdated and retries installation, leaving onboarding at Installation failed.

User impact

The affected Windows v0.4.23 machine had Node and Codex installed. Installing @agentclientprotocol/codex-acp 1.1.7 into Buzz's private prefix was not sufficient: the live onboarding UI still failed. Reproducing Buzz's exact augmented PATH produced "node" is not recognized as an internal or external command.

A temporary local Node delegate placed in Buzz's managed prefix made the exact probe succeed and clicking Retry changed the live UI to Ready. That delegate is only a local workaround and is not part of this PR; this source change fixes the underlying PATH construction.

Validation

  • affected Windows machine: failed probe reproduced with Buzz's current PATH; equivalent fixed PATH returned @agentclientprotocol/codex-acp 1.1.7; onboarding confirmed Ready
  • focused runtime/path.rs tests: 7 passed, 0 failed
  • rustfmt --edition 2021 desktop/src-tauri/src/managed_agents/runtime/path.rs
  • git diff --check

The full Tauri crate test was not completed in this WSL environment because its Linux build requires the full WebKitGTK development stack.

tzarebczan and others added 7 commits July 22, 2026 13:21
Goose install could report success while discovery still saw NotInstalled
(binary in %USERPROFILE%\goose off PATH), blocking onboarding Next (block#2239).
Install shells also dropped the process PATH on Windows so system npm was
invisible for Codex/Claude adapters (block#2238). Console-subsystem probes
stole focus via Git Bash.

- Probe well-known Windows Node/npm/goose paths; fall back to process PATH
  for install shells; pin goose GOOSE_BIN_DIR to ~/.local/bin on Windows.
- Post-install resolve check; SetupStep only shows Installed after discovery.
- Centralize CREATE_NO_WINDOW via windows_console::hide_console (and
  buzz-dev-mcp hide helper) on spawn sites this fix touches.

Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
…ECK AGAIN

- Restore Justfile + CONTRIBUTING.md from main (accidental soft-reset
  squash had undone Hermit-pinned lefthook from block#2241).
- beforeDevCommand: use `pnpm exec vite` instead of Unix-only `exec`
  (tauri.conf + instance-env) so Windows cmd can start the dev server.
- After install success, reuse the existing CHECK AGAIN / CHECKING…
  pattern so rediscovery is not a permanent spinner.

Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
Desktop launches buzz-acp windowless; without the same flag the adapter
child (cmd.exe/node, buzz-agent, …) allocates its own console per agent.

Refs: block#2292, PR block#2247 review
Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
PATH often lists %LOCALAPPDATA%\Microsoft\WindowsApps\bash.exe first;
that App Execution Alias launches WSL and can hang lookups (~15s+) while
real Git Bash is sub-second. Prefer git-derived / install / registry
paths, then PATH bash, and skip WindowsApps (and System32) on PATH.

Refs: block#2328, PR block#2247
Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
Nested CreateProcess sites still flash consoles when the parent is
windowless: buzz-agent MCP spawns and buzz-dev-mcp delegated rg.

Refs: PR block#2247 review, block#2292
Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
- Route desktop spawns through windows_console::hide_console (runtime,
  taskkill); stop re-inlining CREATE_NO_WINDOW.
- Add buzz-dev-mcp windows_console for std/tokio; use from shell + rg.
- Single hide_console helper in buzz-acp and buzz-agent MCP spawn.
- Drop redundant WindowsApps also_skip; one path_looks_like check.
- Align Doctor/MCP PATH scan API + KEEP IN SYNC notes (full shared
  resolver deferred: buzz-agent forbids unsafe registry code).
- SetupStep: one CheckAgainButton for auth-unknown and post-install.

No push.

Signed-off-by: Thomas Zarebczan <thomas.zarebczan@gmail.com>
Signed-off-by: Aleix <aleixrodriala@gmail.com>
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