block / block/buzz

Windows: terminal windows flash constantly — discovery/auth probes and login-shell resolution spawn consoles without CREATE_NO_WINDOW

Open
#2,685 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Environment

- Buzz Desktop **v0.4.23** (installed from the release `Buzz_0.4.23_x64-setup_alpha-unsigned.exe`)
- Windows 11 Home 10.0.26200, Windows Terminal set as the default terminal application
- Agents running on the Claude Code harness (`@agentclientprotocol/claude-agent-acp`), `@agentclientprotocol/codex-acp` 1.1.7 installed, Goose **not** installed

## Symptom

While the app is running (especially when agents wake or the Agents settings view triggers runtime discovery), multiple terminal windows keep popping up, often several at once, stealing focus. With Windows Terminal as the default host each one opens as a full Windows Terminal window titled `C:\Windows\system32\cmd.exe`.

## Evidence — captured process spawns

A process monitor (400 ms polling, parent-chain resolution) captured this burst during one discovery pass. Every chain roots in `buzz-desktop.exe`:

```
[wsl.exe] chain: wsl.exe < buzz-desktop.exe
cmdline: "C:\Users\\AppData\Local\Microsoft\WindowsApps\bash.exe" -l -c "command -v -- \"$1\"" _ goose (x5 in one burst)
[buzz-acp.exe] chain: buzz-acp.exe < buzz-desktop.exe
cmdline: "C:\Users\\AppData\Local\Buzz\buzz-acp.exe" models --json
[cmd.exe] chain: cmd.exe < buzz-desktop.exe
cmdline: cmd.exe /e:ON /v:OFF /d /c ""C:\Users\\...\codex-acp.cmd" --version" (x2)
[claude.exe] chain: claude.exe < buzz-desktop.exe
cmdline: "c:\users\\.local\bin\claude.exe" auth status
[cmd.exe] chain: cmd.exe < buzz-desktop.exe
cmdline: cmd.exe /e:ON /v:OFF /d /c ""C:\Users\\...\codex.cmd" login status"
```

Each of these is a console-subsystem child spawned from a GUI process, so Windows allocates a visible console for every one of them.

## Root cause

`desktop/src-tauri/src/managed_agents/runtime.rs` and `desktop/src-tauri/src/commands/agent_discovery.rs` correctly set `creation_flags(CREATE_NO_WINDOW)` on Windows, but these spawn sites in `desktop/src-tauri/src/managed_agents/discovery.rs` do **not**:

- `probe_auth_status` (runs `claude auth status`, `codex login status`)
- `probe_codex_acp_major_version_with_path` (runs `codex-acp --version`)
- `run_in_login_shell` (runs `bash -l -c 'command -v -- ...'` for every unresolved command)

plus whatever spawns `buzz-acp models --json` for model discovery.

## Two related findings

1. **Login-shell resolution picks WSL bash.** The `command -v goose` probes above ran through `C:\Users\\AppData\Local\Microsoft\WindowsApps\bash.exe`, which is the WSL launcher, not Git Bash — each probe boots a WSL instance (`wsl.exe` + `wslhost.exe`). Git Bash is installed and available on this machine, so `resolve_bash_path` seems to fall back to the PATH `bash.exe` (= WSL on stock Windows 11).
2. **Negative resolutions are not cached** (`resolve_command` only caches `Some` results), so a missing runtime like Goose re-triggers the login-shell probe on every discovery pass — five WSL boots in a single burst here.

## Suggested fix

- Add the existing `cfg(windows) creation_flags(CREATE_NO_WINDOW)` block to the spawn sites listed above (same pattern already used in `runtime.rs`).
- Prefer explicit Git Bash install locations over a bare `bash.exe` PATH lookup on Windows, or at least skip `*\WindowsApps\bash.exe`.
- Consider caching negative resolve results for the duration of one discovery pass.

Happy to provide more traces if useful. Thanks — the app is otherwise working great on Windows (agents on the Claude Code harness run fine).

Contributor guide

Open the contributing guide

Research direction

Start with the existing Windows creation_flags(CREATE_NO_WINDOW) handling in desktop/src-tauri/src/managed_agents/runtime.rs, then inspect probe_auth_status, probe_codex_acp_major_version_with_path, and run_in_login_shell in desktop/src-tauri/src/managed_agents/discovery.rs. Check the related model-discovery spawn path, and verify that discovery and authentication probes no longer open visible console windows on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, tauri
Domain
desktop
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.