Repository navigation
Conversation
The daemon runs under launchd or systemd with a minimal PATH (/usr/bin:/bin:/usr/sbin:/sbin on macOS), and apps inherit it. A CLI the user installed in ~/.local/bin (DoorDash's dd-cli, pipx) or with Homebrew runs from their shell but failed in the app with "executable file not found in $PATH". When the base command is a bare name PATH cannot resolve, the generated adapter now looks in ~/.local/bin, /opt/homebrew/bin, /usr/local/bin and ~/bin before giving up. Paths and staged assets are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
Apps inherit the daemon's environment, and the daemon runs under launchd or systemd with a minimal
PATH. On this Mac the running daemon hasPATH=/usr/bin:/bin:/usr/sbin:/sbin. Every directory on it is system-protected, so a user can't even symlink a tool there.A
cliapp whosebackend.commandis a bare name (noassets) therefore can't find a CLI the user installed per-user, for example in~/.local/bin(DoorDash'sdd-cliinstaller, pipx) or via Homebrew. The call fails withexecutable file not found in $PATH, although the same command works in the user's shell.The generated adapter now does this when the bare command isn't on
PATH: it looks in~/.local/bin,/opt/homebrew/bin,/usr/local/binand~/bin(first executable wins) before giving up. An absolute path or a staged asset is used exactly as before. If nothing is found, the error still names the bare command.Tests
TestCLIAdapterFindsCommandInUserBinDir: it builds a real adapter, starts it with the launchdPATHand aHOMEwhose~/.local/binholds the tool, and calls it over IPC. It fails without this change withexec: "userbintool": executable file not found in $PATH.go build ./...,go vet ./...andgo test ./...pass.gofmtis clean.Needed by the DoorDash CLI app (draft, not listed), which fronts the user's own
dd-clifrom~/.local/bin.🤖 Generated with Claude Code