Skip to content

fix(desktop): restore shell PATH before spawning workers - #906

Open
yxlyx wants to merge 1 commit into
mainfrom
fix/desktop-shell-path
Open

fix(desktop): restore shell PATH before spawning workers#906
yxlyx wants to merge 1 commit into
mainfrom
fix/desktop-shell-path

Conversation

@yxlyx

@yxlyx yxlyx commented Sep 14, 2026

Copy link
Copy Markdown
Collaborator

What changed

Restore the macOS desktop PATH before starting child processes. Merge the inherited path with the login shell path, deduplicate entries, and retain standard Homebrew and system directories as fallbacks. Add regression tests, including executable lookup through a real child shell.

Why

Desktop launches can inherit a restricted PATH, making installed CLI tools appear unavailable. Fixing the parent environment makes command lookup work across desktop workers and their tools rather than special-casing gh or starting a login shell for every tool call.

The shell probe is bounded and imports only PATH. Existing path precedence is preserved; shell startup failure does not prevent the app from opening. Linux and Windows are unchanged. This does not install tools, change authentication, or repair already-running workers.

Validation

  • Desktop test suite
  • Production frontend build
  • Full tier-1 pre-push gate

Closes #897.

Related: #902 and #903. This removes the desktop PATH trigger, but does not claim to fix general agent recovery after a command lookup failure.

Desktop launches can inherit a restricted PATH, hiding installed CLI tools. Recover PATH once from a bounded login-shell probe before starting child processes, preserving inherited precedence and adding standard macOS fallback directories. Import no other shell environment variables and leave other platforms unchanged.
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.

Shell tool cannot resolve installed Homebrew executables

1 participant