Summary
Non-interactive (pipe-mode) SSH sessions do not include /sandbox/.venv/bin in PATH. Packages installed via pip install into the writable sandbox venv are not visible when executing commands non-interactively (e.g., ssh sandbox-host 'pip install foo && python -c "import foo"').
Interactive sessions work correctly because .bashrc sets the PATH, but non-interactive sessions use the hardcoded PATH in ssh.rs.
Root Cause
The PATH is hardcoded in two places in crates/navigator-sandbox/src/ssh.rs and does not include /sandbox/.venv/bin:
- Line 656 (interactive/PTY sessions):
.env("PATH", "/app/.venv/bin:/usr/local/bin:/usr/bin:/bin")
- Line 813 (pipe-mode/non-interactive sessions):
.env("PATH", "/app/.venv/bin:/usr/local/bin:/usr/bin:/bin")
Expected Behavior
Both interactive and non-interactive SSH sessions should include /sandbox/.venv/bin in PATH so that user-installed packages are accessible regardless of session type.
Fix
Update both PATH entries in ssh.rs to:
.env("PATH", "/sandbox/.venv/bin:/app/.venv/bin:/usr/local/bin:/usr/bin:/bin")
/sandbox/.venv/bin must come first so it takes priority over /app/.venv/bin.
Context
This was discovered during the investigation into uv pip install failing under Landlock ABI V1 (EXDEV / cross-device link errors). The workaround switched to pip with a writable /sandbox/.venv, but the hardcoded PATH in ssh.rs was not updated to match.
Summary
Non-interactive (pipe-mode) SSH sessions do not include
/sandbox/.venv/binin PATH. Packages installed viapip installinto the writable sandbox venv are not visible when executing commands non-interactively (e.g.,ssh sandbox-host 'pip install foo && python -c "import foo"').Interactive sessions work correctly because
.bashrcsets the PATH, but non-interactive sessions use the hardcoded PATH inssh.rs.Root Cause
The PATH is hardcoded in two places in
crates/navigator-sandbox/src/ssh.rsand does not include/sandbox/.venv/bin:Expected Behavior
Both interactive and non-interactive SSH sessions should include
/sandbox/.venv/binin PATH so that user-installed packages are accessible regardless of session type.Fix
Update both PATH entries in
ssh.rsto:/sandbox/.venv/binmust come first so it takes priority over/app/.venv/bin.Context
This was discovered during the investigation into
uv pip installfailing under Landlock ABI V1 (EXDEV / cross-device link errors). The workaround switched topipwith a writable/sandbox/.venv, but the hardcoded PATH inssh.rswas not updated to match.