Fix GitNexus not working with non-standard shell after extension updates + 2#10
Merged
Conversation
resolveShellPath() unconditionally overwrote process.env.PATH with the login shell\u2019s PATH (from dash), silently dropping the agent\u2019s existing entries such as ~/.local/share/nvm/v24.15.0/bin. Since the login shell PATH often lacks nvm/fnm/volta directories, child processes could no longer find the gitnexus binary (ENOENT). Add mergePaths() to preserve the agent\u2019s PATH entries and append any shell-only directories at the end, so both sources are represented. Also update the spawnEnv JSDoc to describe the merge behavior.
onSession() is fire-and-forget via void onSession(ctx), discarding the Promise. If resolveShellPath() or probeGitNexusBinary() rejects, the extension enters a partially-initialized state (binaryAvailable stays stale, spawnEnv stays stale) with zero user notification. Add a .catch() handler that surfaces the error message via ctx.ui.notify().
event.content.map() is called without checking if event.content exists. Error tool results can have undefined content, causing a TypeError crash in the async hook that disables all auto-augment for the session. Add a guard at the top of the handler to return early when content is missing or malformed.
tintinweb
reviewed
Apr 30, 2026
tintinweb
reviewed
Apr 30, 2026
/bin/sh does not exist on Windows and on macOS it will not source .zshrc/.zprofile where Homebrew, nvm, volta etc. set their PATH entries. Use $SHELL on macOS/Linux and skip entirely on Windows (where the agent\u2019s PATH is already correct). mergePaths() now uses the platform-appropriate PATH separator (; on Windows, : on macOS/Linux) instead of the hard-coded colon.
resolveShellPath() had no timeout, so a slow or broken login startup file could stall session initialization indefinitely. Add a 3-second deadline that kills the probe and falls back to the agent\u2019s existing PATH. Use node:path delimiter instead of hard-coding ;/:, and make mergePaths filter empty entries and deduplicate case-insensitively on Windows. Correct the JSDoc to reference login startup files (.zprofile, .bash_profile, .profile) rather than interactive rc files (.zshrc, .bashrc), which -lc does not source.
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.
This pull request fixes a bug where gitnexus commands would fail after the Pi coding agent updated pi-gitnexus, along with two small reliability improvements. The main issue happened because the extension was replacing the agent's entire PATH with the login shell's PATH, which lost directories like the one containing Node.js and nvm (where gitnexus was installed).
Changes: