Repository navigation
Find opencode, gh and language servers that only the login shell's PATH has - #124
Merged
Merged
Conversation
…TH has A desktop launch gives Claudiu a minimal PATH. OpenCode's lookup used which::which on that PATH alone, so `opencode` in ~/.opencode/bin was never found, and the lookup never re-read the shell's PATH after an install. The ACP lookup now uses find_executable and reads the login shell's PATH again on a miss. Claudiu also reads that PATH once at startup, and starts Codex, OpenCode, language servers and gh with it, so `npx` and `tsc` can find `node` from nvm.
Language server and gh lookups that ran before the startup read finished missed for good, and a program found on the minimal PATH started without the login shell's PATH. find_executable and with_login_path now wait for the one read.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
m4rocks
added a commit
that referenced
this pull request
Nov 18, 2026
* Keep Claude Code alive when a Codex subagent starts The Codex helper reads the login shell's PATH with `$SHELL -l -i`, and it runs inside Claude Code's terminal. An interactive zsh with a controlling terminal takes over the terminal's foreground while it runs, about half a second on every Codex turn. Claude Code was a background job on its own terminal for that time, and when it touched the terminal then, it died, taking the helper with it. Since #124 this happened on any turn. The login shell now starts in a session of its own (setsid), without a controlling terminal, so it can't take the terminal from anyone. This also covers the --mcp-title server, which runs in the same terminal. * Build without_terminal on Windows only where path_from_shell is
This branch was successfully deployed
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.
On Linux, a desktop-launched Claudiu has a minimal PATH, so
opencodein~/.opencode/binwas never found, even after installing it. The OpenCode and Codex lookup usedwhich::whichon that PATH alone and never re-read the shell's PATH.The ACP lookup now uses
find_executableand reads the login shell's PATH again on a miss. Claudiu reads that PATH once at startup in the background.find_executablewaits for that read on a miss, so a lookup that runs early gets an answer. Codex, OpenCode, language servers and gh start with that PATH, sonpxandtscfindnodefrom nvm. Windows is unchanged.Proof:
cargo clippy --locked --all-targets -- -D warningsis clean.cargo test --lockedpasses (497 passed, 7 ignored).Risk: the first lookup that misses waits up to 5 seconds for the shell, off the UI thread. To undo, revert the merge commit.