Repository navigation
revert: launcher mask identity pin refuses every spawn on a symlinked home (#13715) - #15232
Conversation
…check inspected (#13715)" This reverts commit 3afc7cd. The carried-occupant identity check refuses every spawn on a host whose $HOME is a symlink into the real home directory: the mask lists carry each crew hidden leaf under both spellings, only the resolved one has a recorded identity, and the second spelling reaches the stand-in the first was just masked with. Reopens #12642 until a forward fix lands.
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Confirm #12642 is actually reopened and tracks the re-land, so the reverted TOCTOU hardening is not silently dropped. [DESIGN-REVIEWED] b12be66 Description read[DESCRIPTION-READ] 8d1afc03ba6fe1ec42f6ee3bf6ccd8f2ed8c8bc425e132925e4f8a288982e9a7 That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify #12642 is actually reopened before merge — the diff removes the substitution defence, and only that issue records what is now unprotected. What this change shipsInventory (6 items) — 6 justifiedIntent: FIX — restore agent spawning on hosts whose home directory is a symlink, by reverting #13715 in full.
Root-cause claims verified in the repo: [FIRST-PRINCIPLES-REVIEWED] b12be66 Description read[DESCRIPTION-READ] 07d59f703382c371c1cb2eb2c42e1f55ff971c58384c399c3b910ab6f9236652 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
…uncher's own stand-in Re-lands #13715 (reverted in #15232) with the one case it did not handle. A mask list can carry one object under two spellings. A symlinked $HOME makes the data home read as relocated, so each crew hidden leaf is listed under both the link's spelling and the resolved one, while the pre-spawn pass records an occupant identity for the resolved spelling only. The launcher masks the first spelling by binding a stand-in over it; the second spelling then resolves to that stand-in, whose (dev, ino) is not the recorded one, and the identity check refused it as a swapped object. On such a host every spawn was refused. The launcher now records the (dev, ino) of every stand-in it creates, and a changed occupant that IS one of those stand-ins -- read no-follow at the name, never through a link -- is the mask already in place: the pin skips it. A link planted at the name and aimed into the stand-in tmpfs still refuses, so the substitution #13715 closes stays closed. Closes #12642.
…uncher's own stand-in (#15252) Re-lands #13715 (reverted in #15232) with the one case it did not handle. A mask list can carry one object under two spellings. A symlinked $HOME makes the data home read as relocated, so each crew hidden leaf is listed under both the link's spelling and the resolved one, while the pre-spawn pass records an occupant identity for the resolved spelling only. The launcher masks the first spelling by binding a stand-in over it; the second spelling then resolves to that stand-in, whose (dev, ino) is not the recorded one, and the identity check refused it as a swapped object. On such a host every spawn was refused. The launcher now records the (dev, ino) of every stand-in it creates, and a changed occupant that IS one of those stand-ins -- read no-follow at the name, never through a link -- is the mask already in place: the pin skips it. A link planted at the name and aimed into the stand-in tmpfs still refuses, so the substitution #13715 closes stays closed. Closes #12642.
Problem / Motivation
Goal: Agents start again on hosts whose home directory is a symlink, by reverting the launcher mask identity check that refuses every spawn there.
Since #13715 (3afc7cd) merged, a gateway running on a host where
$HOMEis a symlink into the real home directory (for example/home/user -> /data/home/user) cannot start a single agent process. Every spawn dies in the sandbox launcher with:The dashboard shows "Session stuck -- please start a new chat" on every session, the warm pool never fills, and the readiness probe fails. Retrying does not help; the only offered remedy is to turn the OS sandbox off for every agent.
Why it matters
Any operator with a symlinked home (a common layout on machines whose home directories live on a separate volume) loses every agent after upgrading to a build that carries #13715. There is no working configuration short of disabling the sandbox, and the failure looks like a session-level problem rather than an upgrade regression, so it is hard to diagnose.
Not a goal
_relocated_crew_targets()to resolve symlinks. It deliberately avoidsrealpathon the event loop, and its redundant second spelling was harmless before fix(sandbox): bind each launcher mask to the object its own check inspected #13715.What changed (motivation -> approach -> change)
Symptom: every spawn refused with the BLOCKED message above.
Root cause:
_relocated_crew_targets()comparesnormpathspellings, so on a symlinked home it reports the data home as relocated and emits each crew hidden leaf twice in the launcher's mask list -- once under/home/user/...and once under/data/home/user/.... Both names are the same inode. #13715 added a pre-spawn pass (_masked_crew_home_roots) that records the(dev, ino)identity of each mask target, deduplicated by inode, so only the resolved spelling gets an expectation. In the launcher, the first spelling is masked by binding a tmpfs stand-in over it. The second spelling then resolves to that stand-in, whose identity differs from the recorded one, and the new comparison treats it as a swapped object and exits. A layout that was documented as producing "a redundant rule for a path that is covered either way, never a missing one" became fatal.Change: revert #13715 in full (
git revert 3afc7cdaaef16617475aee91a3b62adcf23fdf65, conflict-free). This restores the pre-#13715 launcher, its tests and the security spec section, and reopens #12642 until a forward fix lands.Backwards compatibility
Compatible: this restores the launcher behaviour every release before #13715 shipped; nothing that works today stops working.
Tests
No new tests. The revert removes the two test modules #13715 added (
test_sandbox_launcher_symlinked_protected_name.py,test_sandbox_mount_pinned_target.py) and restores the pre-#13715 assertions in the seven sandbox test modules it touched. Ran the seven restored modules against this head: 1233 passed, 4 skipped.Manual verification
On the affected host (symlinked home, sandbox level default), applied this diff to the running gateway's checkout: the next spawn produced a launcher without the identity check, the agent started, and the "Session stuck" sessions resumed. Before the diff, every spawn from the same gateway since the #13715 upgrade had failed with the BLOCKED message.
Screenshots / video
N/A -- backend-only change, no user-visible frontend surface.
Related Issues
Reverts #13715. Reopens #12642.
Pattern harvest
Rule candidate: review-prompt
Pattern: a fail-closed identity check added to a path list must be tested with the list's known duplicate spellings (symlinked home, relocated data home), because a duplicate that was harmless under "mask by name" becomes fatal under "mask by identity".
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)