Skip to content

fix(bots): keep sandbox parking and Pi start failures on Linux; update sandbox test fixtures - #2521

Merged
TheAnimatrix merged 2 commits into
masterfrom
fix-nightly-206-regressions
Dec 1, 2026
Merged

TheAnimatrix merged 2 commits into
masterfrom
fix-nightly-206-regressions

Conversation

@TheAnimatrix

@TheAnimatrix TheAnimatrix commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

Nightly run 206 failed in 4 test shards (6 files) after #2507 (f17de91) and #2513 (38d17c4) landed on master:

  1. Bot sandbox parking on Linux (src/mms/bots/activation/BotEngine.ts, tests/bots/botSandboxSetting.test.ts:156): when work met an unavailable sandbox on a secondary launcher (such as a subagent's entry), the completion check only resolved the work's own provider and Mousse's runner, ignoring sandboxNeeds. It passed on Windows only because Mousse's runner is unavailable on Windows; on Linux where Mousse's runner starts, the work finished done instead of parking as blocked (endReason: 'sandbox'). The same test also asserted view.runner was unavailable on every OS even though Linux runners start.
  2. Pi held-command immediate sandbox start failure (src/mms/harness/pi/extension/shell.ts, tests/harness/piBotGate.test.ts:332): when bwrap exits with code 1 before /pi/group can verify the process group (for example, a missing bind folder), options.report(pid) rejects and botBashOperations rethrew that error without checking heldStartFailure, so startFailed was never called and the model did not receive the sandbox refusal.
  3. Pi held-command Linux test path (tests/harness/piBotGate.test.ts:323): touch "${join(root, '..', 'outside.txt')}" wrote into /tmp/<scratch>/outside.txt, whose parent directory bwrap creates on its writable private --tmpfs /tmp in order to mount files and scratch underneath it, so touch exited 0 on Linux.
  4. Bot dispatcher test fixtures (tests/bots/botReplyFinalMessage.test.ts, tests/bots/botContinuationPermission.test.ts): fake authority objects cast as never omitted sandbox, causing ClaudeCodeAdapter to throw Cannot destructure property 'policy' of 'bot.sandbox' as it is undefined.
  5. Codex adapter test (tests/run/codexAdapter.test.ts:2870): fake codex script was written without chmodSync(binary, 0o755), so Linux rejected it as not executable (Codex CLI not found).

(The 6th failure from run 206, tests/contractVersions.test.ts, was already updated to botsDb: 20 on master in #2520.)

Change

  • src/mms/bots/activation/BotEngine.ts: include recorded sandboxNeeds launchers when checking whether completed work should park on sandbox, and clear stale sandboxNeeds when it does not park.
  • src/mms/harness/pi/extension/shell.ts: in containedBashOperations, attach the drained exitCode to errors thrown when group registration fails; in botBashOperations, run heldStartFailure on that exitCode and captured output so immediate sandbox start failures report startFailed and return botSandboxRefusal.
  • tests/bots/botSandboxSetting.test.ts: set f.host.platform = 'linux' while testing secondary-entry parking (so it fails without the BotEngine.ts fix on Windows too) and 'win32' for the assertion where Mousse's runner must be unavailable.
  • tests/harness/piBotGate.test.ts & tests/harness/piShell.test.ts: test writes against an unmounted sibling outside folder in the real-sandbox test, and add unit tests covering a wrapper that exits before /pi/group records it.
  • tests/bots/botReplyFinalMessage.test.ts & tests/bots/botContinuationPermission.test.ts: provide an open sandbox on the test dispatcher's authority.
  • tests/run/codexAdapter.test.ts: add chmodSync(binary, 0o755) after writing the fake codex script.

Verification

Tier 4 (BotEngine.ts, Pi extension shell, and 6 test files). Reviewed by fresh subagent (Nightly 206 fix reviewer): 1 blocker fixed (tests/contractVersions.test.ts conflict with #2520 resolved by merging origin/master), 0 declined.

Tested on commit e734989c62f0c61c907f91e35a49cd69ef1666e2:

  • PASS tests: 7 file(s), 276 test(s), 1 failed (1 known: #2405) — npx vitest run tests/contractVersions.test.ts tests/bots/botContinuationPermission.test.ts tests/bots/botReplyFinalMessage.test.ts tests/bots/botSandboxSetting.test.ts tests/harness/piBotGate.test.ts tests/harness/piShell.test.ts tests/run/codexAdapter.test.ts
  • PASS typecheck:node: no errors — tsc --noEmit -p tsconfig.node.json
  • PASS typecheck:web: no errors — tsc --noEmit -p tsconfig.web.json
  • Not tested locally on Linux (bwrap real-child tests); verified by unit tests locally and by the Linux full test suite in the next nightly after merge.

Notes

  • Review note (R2): tests/harness/piShell.test.ts uses a 150 ms sleep before rejecting report; replacing it with an exit-event promise from a wrapped spawn can eliminate any latency sensitivity on heavily loaded Windows runners.
  • Review note (R3): keeping the pre-existing resolveNow(..., { runner: 'mousse' }, 'watcher').kind === 'unavailable' clause in BotEngine.ts means Windows turns whose only failed secondary entry recovered before turn-end still park; pre-existing and out of scope here.

No issue

@TheAnimatrix
TheAnimatrix merged commit e204107 into master Dec 1, 2026
11 checks passed
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.

1 participant