Repository navigation
Description
Symptom
The preflight merged in #610 (squash 7eae271c, Fixes #607) reports a blocked sandbox for sessions it cannot see, and the instruction it feeds then stops a working session. #607 was closed as completed; this tracks the defect that shipped with it.
Reviewer's INC on the PR (#610#issuecomment-6314730587, 11:24:37Z) was posted before the merge (11:25:23Z) and none of its three items is in the merged code: main's .github/scripts/sandbox-preflight.mjs is byte-identical to the reviewed tip e7ccdd06 (sha256 of the file, 4832 bytes). Found by the reviewer while reviewing the PR; no code changed here.
Evidence (reproduced at the reviewed tip, unchanged on main at 81c708d0)
$ node .github/scripts/sandbox-preflight.mjs
sandbox-preflight: workspace-write is UNAVAILABLE: no usable sandbox backend (bubblewrap missing or not runnable; Landlock not enabled). Every shell call will be refused with SANDBOX_UNAVAILABLE. … Unlock: …
$ echo hello && id -u
hello
10001The session that ran it was on danger-full-access (bash works, as shown), yet the line says every shell call will be refused. AGENTS.md's new paragraph then says: if it is blocked, report one line and do not retry shell calls — so an agent on danger-full-access, or any Windows session, is told to stop doing shell work that works.
Cause
.github/scripts/sandbox-preflight.mjs:18—export const MODE = 'workspace-write'is hardcoded; the script always answers for a mode the caller may not be on, and no tool exposes the session's actual DSH file policy to the plugin..github/scripts/sandbox-preflight.mjs:62—'acl-runner': () => false: the Windows restricted-token runner cannot be probed from here, butfalseis reported as blocked, and:64makes it the only candidate on Windows, so every Windows session reads as blocked even when the runner works..github/scripts/sandbox-preflight.mjs:76—describe()interpolates the module constantUNLOCKinstead ofresult.unlock.
Fix (mechanical, as proposed on the PR)
- Take the mode from an argument/env (
--mode <tier>/FLYBOT_SANDBOX_MODE) and answer for that mode only; with no mode given, print the conditional wording ("if this session is onworkspace-write, every shell call is refused"). - Give
backendsa third state (unknown) foracl-runner;usablestays false, but the exit code must separate proven blocked (3) from cannot probe (new code), andAGENTS.md/docs/sandbox.mdsay "do not stop on unknown". describe(result)readsresult.unlock;resolveOnPathchecksstatSync().isFile()so a directory namedbwrapreads as missing;docs/sandbox.md"it print" → "it prints".
Tests, all red without the change:
--mode danger-full-access(or the env) → exit 0 and no "will be refused" line;--mode workspace-writewith no backend → exit 3 (the existing test);acl-runnerunknown → exit code for unknown, JSON carriesunknown: true;- a directory named
bwrapon a fakePATH→bwrap: false.
Acceptance
On a danger-full-access session the preflight never tells the agent to stop; on Windows it reports unknown, not blocked; an agent following AGENTS.md cannot conclude "blocked" from a probe that only tested one mode.
Notes
- The unlabelled
risk:T*on fix: preflight the sandbox backend and name a blocked session (#607) #610 stays a controller matter; this issue is the behaviour, not the label. - If the fix-forward is chosen (rather than a revert of
7eae271c), this is its issue: one issue, one PR. - Related: fix: preflight the sandbox backend and name a blocked session (#607) #610, New Bot sessions with
workspace-writehave no usable sandbox backend and stall silently #607 (closed), Rule says the controller setsrisk:T*, butrisk-tier.ymlis report-only and never writes labels #609 (labels written by the controller).
Activity
Answer the sandbox preflight for the mode it is given (#615)
Birfy commentedon Oct 21, 2026
Claiming. Branch
fix/615-preflight-mode, fix-forward on top ofmain9f3aa7d.Why a new branch instead of the original one: #610's branch
fix/607-sandbox-preflightwas merged (squash7eae271c) 46 s after the reviewer posted INC, so it cannot take commits any more; #607 stays closed and this issue carries the rework.What the rework does: the mode comes from
--mode <tier>/FLYBOT_SANDBOX_MODE(with no mode the output is conditional),danger-full-accessneeds no backend and is never reported blocked,acl-runnerreportsunknowninstead offalse, the exit code separates proven blocked (3) from cannot-tell (4),describe()readsresult.unlock,resolveOnPathrequires a file, anddocs/sandbox.md/AGENTS.md/fix-issuesay not to stop on 4.fix(preflight): answer for the file policy it is given, and never cal…