Desktop readiness ignores per-agent auth environment and blocks signed-in Claude accounts
Bug
Buzz Desktop 0.5.23 on macOS (Apple Silicon) starts an authenticated managed Claude agent in setup-listener mode when the agent uses a separate CLAUDE_CONFIG_DIR and the desktop's default Claude account is logged out. The agent never starts its normal model pool; mentions produce setup nudges instead of normal replies.
Reproduction
- Configure a managed Claude agent with its own
CLAUDE_CONFIG_DIRin its effective environment. - Authenticate that account. Leave the default Claude configuration logged out.
- Compare the same CLI under the two environments:
claude auth status:loggedIn: false, exit 1.CLAUDE_CONFIG_DIR=/path/to/agent-account claude auth status:loggedIn: true,authMethod: claude.ai, exit 0.
- Start/restart the agent in Buzz.
Observed on a live installation: the runtime received the correct agent-specific CLAUDE_CONFIG_DIR, but also received a BUZZ_ACP_SETUP_PAYLOAD containing surface: cli_login, availability: available, and probe_args: ["claude", "auth", "status"]. Its log then recorded:
buzz-acp: setup payload present, entering setup-listener mode
buzz-acp entering setup mode ... requirements=1
The relay connection and channel subscriptions succeeded. Other Claude agents using separate account directories were affected as well. This is a local startup readiness failure, not evidence of a relay delivery failure.
Expected
The startup readiness check uses the same account environment as the agent being launched. An authenticated isolated account should start the normal agent pool even if the desktop's default account is logged out.
Root cause
In desktop/src-tauri/src/managed_agents/:
runtime.rsconstructsEffectiveAgentEnvfromdescriptor.envfor readiness and later applies that environment to the launched process.readiness.rs::collect_missing_requirementsdoes not pass the effective environment tocli_login::requirementsfor Claude/Codex.readiness/cli_probe.rs::login_probeonly overridesPATH; the auth subprocess otherwise inherits the desktop's environment.
Thus the startup probe and the actual agent consult different account configurations. The same omission affects CODEX_HOME routing, although the reported live failure was reproduced with Claude.
Fix direction
Pass the effective environment through cli_login::requirements into login_probe, applying it to the child process with the same precedence as agent startup. Keep failed-account and invalid-config classification intact. Add regression coverage for account-specific config paths (including spaces) and logged-out accounts.
A local patch and regression test are prepared; deployment validation is in progress. No upstream PR yet.
Related: #5460 describes CLI/adapter credential-store disagreement. This report isolates the additional per-agent environment omission in the startup readiness path, reproducible with the same CLI binary simply by changing CLAUDE_CONFIG_DIR.
Two more concrete leads from continuing to chase this on our own setup (desktop, macOS, just dev), neither yet confirmed as the definitive root cause but both specific enough to be worth sharing.
1. Claude Code's OAuth/subscription auth depends on macOS Keychain reads, separate from API-key auth
security find-generic-password -s "Claude Code-credentials" → present in the login keychain
~/.claude/.credentials.json → plaintext fallback also present
claude --help documents this directly: its --bare flag exists specifically to skip "prefetches, keychain reads, ... Anthropic auth is strictly ANTHROPIC_API_KEY or apiKeyHelper ... OAuth and keychain are never read" in that mode. So subscription/OAuth login is Keychain-dependent by design, distinct from API-key auth.
We separately hit a real, reproducible Keychain-access failure for Buzz's own agent-key storage this week: keyring unavailable: Platform secure storage failure: User interaction is not allowed when Buzz was spawned without a normal interactive session (background/non-GUI launch context). If Buzz's internal readiness-probe subprocess doesn't get the same Keychain access an interactive terminal session does, claude auth status run by Buzz could plausibly fail to read an OAuth token from Keychain and report "not authenticated," while the identical command run directly in a terminal succeeds — matching #7836's core finding that the probe and the real launch can end up consulting different effective auth state, just naming a specific mechanism (Keychain ACL/session-context, not only env vars like CLAUDE_CONFIG_DIR).
2. resolve_command's app-lifetime cache can go stale across a live Claude Code self-update
Claude Code self-updates by swapping ~/.local/bin/claude (a symlink) to point at a new versioned binary under ~/.local/share/claude/versions/, while the old binary file stays on disk unless/until cleaned up. On our setup:
~/.local/share/claude/versions/2.1.283 mtime 2026-09-26
~/.local/share/claude/versions/2.1.285 mtime 2026-09-29 (just now)
~/.local/bin/claude -> .../2.1.285 symlink re-pointed same moment
desktop/src-tauri/src/managed_agents/discovery.rs's resolve_command caches a resolved command's absolute path "for the app lifetime," explicitly to avoid re-running the (expensive) login-shell resolution on every cheap discovery call. A long-running Desktop session (ours has been up since before this Claude update) would have cached the old binary's path the first time it resolved claude, then kept using that stale path after the self-update repointed the symlink to a new version. If the newer Claude Code version rotated/re-signed its credential format on update (a plausible and common pattern), the old cached binary could fail to read the new credential state and report "not authenticated," even though the current binary (which any fresh terminal command always resolves to, since a terminal never holds a stale cache) reads it fine.
This would explain a report pattern we independently hit: Claude-backed agents authenticate and work correctly for a while, then start reporting "needs configuration" specifically after a Claude Code version update lands while Buzz Desktop keeps running uninterrupted — no config change, no Buzz restart, just time passing and a background CLI update. A full Buzz Desktop restart (clearing the in-process cache) is a plausible, cheap way to test this distinction: if agents that were failing come back to life on Claude after nothing but a restart, this cache is very likely at least part of the story. Haven't yet confirmed the credential-rotation half of this (i.e., whether the older binary genuinely can't read the newer credential state) — that would need reproducing with two pinned Claude Code versions side by side, which we haven't set up.
Sharing both in case either narrows things down; happy to help verify further with more specific repro steps if useful.