fix(desktop): resolve agent command path for DMG builds#372
Merged
Conversation
The desktop now resolves the agent command (e.g. claude-agent-acp) to a full path via resolve_command() before passing it to sprout-acp via SPROUT_ACP_AGENT_COMMAND. This matches how we already handle the harness (sprout-acp) and MCP server (sprout-mcp-server) commands. Fixes ACP agent startup when launched from Finder where PATH is minimal (/usr/bin:/bin:/usr/sbin:/sbin) and npm-installed binaries aren't found. Uses soft fallback (unwrap_or_else) so custom/unknown agent paths still pass through to sprout-acp for its own error handling.
Same fix as the runtime path: resolve the agent command to a full path via resolve_command() before passing it to sprout-acp via SPROUT_ACP_AGENT_COMMAND in get_agent_models(). Without this, model discovery fails on DMG builds launched from Finder where PATH is minimal.
When Sprout.app launches from a DMG via Finder, the inherited PATH is minimal (/usr/bin:/bin:/usr/sbin:/sbin). PR #372 resolved agent binaries to full paths, but spawned processes (sprout-acp) still inherited the anemic PATH. This meant #!/usr/bin/env node scripts like claude-agent-acp couldn't find their runtime. Adds login_shell_path() which probes the user's login shell for the full PATH (cached via OnceLock for the app lifetime, noise-filtered to handle chatty shell profiles). Injects this PATH into both agent startup (runtime.rs) and model discovery (agent_models.rs). Also refactors find_via_login_shell() and login_shell_path() to share a common run_in_login_shell() helper. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
fsola-sq
added a commit
that referenced
this pull request
Apr 20, 2026
…-binding * origin/main: fix(desktop): eliminate agent startup beachball (#374) fix(desktop): resolve agent command path for DMG builds (#372) fix(desktop): remove stale sprout-admin prereq, add sidecar tooling (#371) Add server cross-compile and macOS desktop build CI jobs (#369) Fix forum post card bugs on desktop and mobile (#370) fix(desktop): kill WebSocket flood and fix Markdown <p><div> nesting (#368) perf: caching, batched DM resolution, bounded audit, global kind index (#367) fix: staging to generate stubs as needed (#366) chore(deps): update rust crate axum to v0.8.9 (#365) chore(deps): update dependency @tanstack/react-router to v1.168.22 (#364) feat(desktop): autoscroll thread sidebar for new replies (#363) fix(desktop): eliminate 10+ second UI freeze on startup (#361) feat(desktop): bundle sprout-acp and sprout-mcp-server as Tauri sidecars (#362) Remove release pipeline from public repo (#360) Amp-Thread-ID: https://ampcode.com/threads/T-019dab7a-5979-7401-83a1-509b9adfe4a0 Co-authored-by: Amp <amp@ampcode.com> # Conflicts: # crates/sprout-relay/src/state.rs
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
claude-agent-acp) to a full path viaresolve_command()before passing it tosprout-acp, matching how we already handle the harness and MCP server commandsruntime.rs) and model discovery (agent_models.rs)Context
When the desktop app is launched from a DMG via Finder, the inherited PATH is minimal (
/usr/bin:/bin:/usr/sbin:/sbin). npm-installed binaries likeclaude-agent-acparen't on this PATH. The desktop already resolvessprout-acpandsprout-mcp-serverusingresolve_command()(which does login-shell PATH lookup), but was passing the agent command as a raw string.Test plan
claude-agent-acpjust stagingstill works (no regression)