Skip to content

revert: launcher mask identity pin refuses every spawn on a symlinked home (#13715) - #15232

Merged
chenmingwei23 merged 1 commit into
mainfrom
revert/13715-launcher-mask-pin
Sep 30, 2026
Merged

chenmingwei23 merged 1 commit into
mainfrom
revert/13715-launcher-mask-pin

Conversation

@chenmingwei23

@chenmingwei23 chenmingwei23 commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

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 $HOME is 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:

sandbox: BLOCKED -- cannot pin /data/home/user/.kirocrew/diag to mask it:
a DIFFERENT object holds that name than the one the pass that established it saw

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

What changed (motivation -> approach -> change)

Symptom: every spawn refused with the BLOCKED message above.

Root cause: _relocated_crew_targets() compares normpath spellings, 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

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

…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.
@chenmingwei23
chenmingwei23 requested a review from a team as a code owner September 30, 2026 01:12
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 30, 2026
@github-actions

github-actions Bot commented Sep 30, 2026 •

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of b12be66b42687b6c3145b3dba415d1ad5602fe3e and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] b12be66

False positive or not applicable? A repository writer can comment:
/ai-review override gpt b12be66b42687b6c3145b3dba415d1ad5602fe3e: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of b12be66b42687b6c3145b3dba415d1ad5602fe3e — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

First Principles Review (Fable 5) — ✅ PASS

Premise-level review of b12be66b42687b6c3145b3dba415d1ad5602fe3e — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

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 ships

Inventory (6 items) — 6 justified

Intent: FIX — restore agent spawning on hosts whose home directory is a symlink, by reverting #13715 in full.

  1. Agents spawn again on symlinked-home hosts; the "BLOCKED — cannot pin" refusal is gone — justified
  2. The spawn no longer refuses an object swapped at a protected name between gateway check and child mount (reopens Every sandbox pre-spawn pass validates a name the launcher resolves again #12642) — justified
  3. Ordinary inode changes at protected names (atomic rewrites, rebuilt staging dirs) no longer refuse spawns — justified
  4. A symlinked ~/.ssh is again silently skipped by the mask, as before fix(sandbox): bind each launcher mask to the object its own check inspected #13715 — justified
  5. The security spec's identity-carriage section is removed in the same commit — justified
  6. Two fix(sandbox): bind each launcher mask to the object its own check inspected #13715 test modules deleted; seven modules restored to pre-fix(sandbox): bind each launcher mask to the object its own check inspected #13715 assertions — justified

Root-cause claims verified in the repo: sandbox.py:5294-5298 says normpath, never realpath, and that a symlinked home "yields a redundant rule … never a missing one" — the pre-existing promise #13715 turned fatal; security.md:113 documents the symlinked data home as supported. Deleted pins are named in the description with evidence they were wrong on a supported layout; the forward fix is explicitly deferred under "Not a goal".

[FIRST-PRINCIPLES-REVIEWED] b12be66

Description read

[DESCRIPTION-READ] 07d59f703382c371c1cb2eb2c42e1f55ff971c58384c399c3b910ab6f9236652

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

Copy link
Copy Markdown
Contributor

Opus 5 Review — ✅ no blocking findings

Reviewed b12be66b42687b6c3145b3dba415d1ad5602fe3e — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] b12be66

Verdict parsed from the review's SHA-scoped output markers for commit b12be66b42687b6c3145b3dba415d1ad5602fe3e.

False positive or not applicable? A repository writer can comment:
/ai-review override fable b12be66b42687b6c3145b3dba415d1ad5602fe3e: <one-sentence reason>

@github-actions github-actions Bot added readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running labels Sep 30, 2026
@chenmingwei23
chenmingwei23 merged commit f4df23e into main Sep 30, 2026
98 of 104 checks passed
@chenmingwei23
chenmingwei23 deleted the revert/13715-launcher-mask-pin branch September 30, 2026 02:45
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 30, 2026
chenmingwei23 added a commit that referenced this pull request Sep 30, 2026
…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.
bolichen97 pushed a commit that referenced this pull request Sep 30, 2026
…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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants