Repository navigation
fix(bots): keep sandbox parking and Pi start failures on Linux; update sandbox test fixtures - #2521
Merged
Merged
Conversation
…e sandbox test fixtures
…ressions # Conflicts: # tests/contractVersions.test.ts
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.
Problem
Nightly run 206 failed in 4 test shards (6 files) after #2507 (
f17de91) and #2513 (38d17c4) landed onmaster: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, ignoringsandboxNeeds. It passed on Windows only because Mousse's runner is unavailable on Windows; on Linux where Mousse's runner starts, the work finisheddoneinstead of parking asblocked(endReason: 'sandbox'). The same test also assertedview.runnerwas unavailable on every OS even though Linux runners start.src/mms/harness/pi/extension/shell.ts,tests/harness/piBotGate.test.ts:332): whenbwrapexits with code 1 before/pi/groupcan verify the process group (for example, a missing bind folder),options.report(pid)rejects andbotBashOperationsrethrew that error without checkingheldStartFailure, sostartFailedwas never called and the model did not receive the sandbox refusal.tests/harness/piBotGate.test.ts:323):touch "${join(root, '..', 'outside.txt')}"wrote into/tmp/<scratch>/outside.txt, whose parent directorybwrapcreates on its writable private--tmpfs /tmpin order to mountfilesandscratchunderneath it, sotouchexited0on Linux.tests/bots/botReplyFinalMessage.test.ts,tests/bots/botContinuationPermission.test.ts): fakeauthorityobjects castas neveromittedsandbox, causingClaudeCodeAdapterto throwCannot destructure property 'policy' of 'bot.sandbox' as it is undefined.tests/run/codexAdapter.test.ts:2870): fakecodexscript was written withoutchmodSync(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 tobotsDb: 20onmasterin #2520.)Change
src/mms/bots/activation/BotEngine.ts: include recordedsandboxNeedslaunchers when checking whether completed work should park onsandbox, and clear stalesandboxNeedswhen it does not park.src/mms/harness/pi/extension/shell.ts: incontainedBashOperations, attach the drainedexitCodeto errors thrown when group registration fails; inbotBashOperations, runheldStartFailureon thatexitCodeand captured output so immediate sandbox start failures reportstartFailedand returnbotSandboxRefusal.tests/bots/botSandboxSetting.test.ts: setf.host.platform = 'linux'while testing secondary-entry parking (so it fails without theBotEngine.tsfix 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 siblingoutsidefolder in the real-sandbox test, and add unit tests covering a wrapper that exits before/pi/grouprecords it.tests/bots/botReplyFinalMessage.test.ts&tests/bots/botContinuationPermission.test.ts: provide an opensandboxon the test dispatcher'sauthority.tests/run/codexAdapter.test.ts: addchmodSync(binary, 0o755)after writing the fakecodexscript.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.tsconflict with #2520 resolved by mergingorigin/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.tsPASS typecheck:node: no errors—tsc --noEmit -p tsconfig.node.jsonPASS typecheck:web: no errors—tsc --noEmit -p tsconfig.web.jsonbwrapreal-child tests); verified by unit tests locally and by the Linux full test suite in the next nightly after merge.Notes
tests/harness/piShell.test.tsuses a 150 ms sleep before rejectingreport; replacing it with an exit-event promise from a wrappedspawncan eliminate any latency sensitivity on heavily loaded Windows runners.resolveNow(..., { runner: 'mousse' }, 'watcher').kind === 'unavailable'clause inBotEngine.tsmeans Windows turns whose only failed secondary entry recovered before turn-end still park; pre-existing and out of scope here.No issue