Repository navigation
fix(sandbox): keep the image's tools on PATH in login shells - #5019
Merged
Merged
Conversation
The runtime image puts node, npm and the agent CLIs on PATH with ENV, and entrypoint.sh puts the session's pip and npm prefixes in front. A login shell discards all of it: Debian's /etc/profile resets PATH, then reads /etc/profile.d. On the published image (0.5.91), `bash -lc 'command -v npm node codex'` finds none of them, as uid 10001 and as 65534; only bun, uv and python3 in /usr/local/bin survive. Two things run login shells: runnerd's `shell` exec form (`bash -lc`) and the shell tool of the Codex harness, which the pinned Codex runs as `/bin/bash -lc`. Against a stand-in model server, that tool found none of node, npm or codex in the image. Install the same directories from /etc/profile.d/tale-path.sh, in front of what /etc/profile built. Root gets only the image's directories, never the session's, which the agent can write. A daemon test holds the file to the Dockerfile's ENV PATH and to entrypoint.sh; the image conformance test and the Incus lab each run a login shell and look for the tools.
yannickmonney
force-pushed
the
fix/sandbox-login-shell-path
branch
from
October 19, 2026 14:50
929b462 to
c6f759a
Compare
yannickmonney
added this pull request to the merge queue
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
yannickmonney
added this pull request to the merge queue
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
yannickmonney
added this pull request to the merge queue
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
yannickmonney
added this pull request to the merge queue
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
yannickmonney
added this pull request to the merge queue
Oct 19, 2026
github-merge-queue
Bot
removed this pull request from the merge queue due to failed status checks
Oct 19, 2026
yannickmonney
added this pull request to the merge queue
Oct 19, 2026
5 tasks done
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
A login shell in the sandbox runtime image does not find
node,npm,npx, the agent CLIs (codex,claude, ...) or a package a session installed, because Debian's/etc/profileresetsPATHand the image sets its own only throughENV. This installs the same directories from/etc/profile.d/tale-path.sh.Evidence, on the published image
ghcr.io/tale-project/tale/tale-sandbox-runtime:0.5.91(the Dockerfile has no/etc/profile.dentry onmaineither):bash -c 'command -v npm node codex'finds all three;bash -lcfinds none (as uid 10001 and 65534).PATHbecomes/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games.shellexec form (bash -lc,daemon/src/exec-manager.ts) and the shell tool of the Codex harness. The pinned Codex, driven against a stand-in model server in that image, ran/bin/bash -lcand found none ofnpm,node,codex./agent/.runtime/deps/python/bin:/agent/.runtime/deps/node/bin:/opt/agents/bin:/opt/node/bin:/usr/local/bin:....Found by the Incus lab on #5017, whose new registry-cache test runs
npm cithrough theshellform and gotnpm: command not found.Why the image and not the daemon: switching runnerd to
bash -cwould fix only its ownshellform and leave Codex's shell tool without node. The file is root-owned in the image, covers every login shell, and keeps the session's dependency directories (entrypoint.sh) in front for the agent, never for root.Checklist
bun run checkpasses (format, lint, typecheck, all tests). Not run as a whole locally: this Mac runs at load 8-9 and 5 s test timeouts flake (entrypoint-dispatch/dev/shm, a Trivy SARIF fixture). The daemon workspace's tests, lint, typecheck and format pass otherwise; CI runs the rest.bun run lint:sastpasses (Opengrep) — ran in the pre-commit hook on the staged files.README.md/README.de.md/README.fr.md: N/A.Test plan
services/sandbox-runtime/daemon/src/login-shell-path.test.ts(Unit): runs the file as/etc/profilewould, for uid 10001 and root, against the directories parsed from the Dockerfile'sENV PATHandentrypoint.sh; fails if any of the three drifts. Checked to fail with the file broken.container-sandbox-runtime-test.ts, Build): a login shell finds node, npm, npx, nodejs, bun, uv, codex and claude, andPATHstarts with the session and image directories.lifecycle.e2e.ts, new step):shellandcommandexecs resolve the same tools to the same paths on a real session. The lab job runs on this pull request because it touchesservices/sandbox-runtime/**.