swarm: the sandbox setup hook inherits Sandcastle's 60 s default and reds the run — observed pnpm install max is 46.5 s, 5 breaches in 1031 worker logs #1142
Labels
No labels
agent-blocked
agent-working
autopilot
bug
deferred
deploy-pending
enhancement
landing-pr
model-haiku
model-opus
model-sonnet
needs-design
needs-info
needs-triage
no-triage
out-of-scope
priority
ready-for-agent
ready-for-human
ready-for-session
rehearsal-183
snapshot-pending
standing-drive
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Matou/idss#1142
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The vendored Sandcastle orchestrator declares the sandbox setup hook with no
explicit
timeoutMs, so it inherits Sandcastle's 60 s default:@ai-hero/sandcastle@0.12.0supports a per-command ceiling(
SandboxHooks.sandbox.onSandboxReady[].timeoutMs,dist/index.d.ts:287-289).Nothing sets it here.
Why 60 s is too tight
Across all 1019 successful
Setting up sandbox done (Ns)lines in.sandcastle/logs/(that figure covers BOTH hook commands, so the installalone is slightly less):
The observed maximum sits at 1.3x under the ceiling. A right tail that
close to its cap breaches on ordinary host contention — the 2-wide swarm
matrix plus concurrent
triage/resume/publishjobs share one workstation,and the pnpm store is a single host-mounted directory.
Recurrence — 5 breaches in 1031 worker logs
main-sandcastle-worker-20260814-165801-4f9726main-sandcastle-worker-20260819-182627-acdc93main-sandcastle-worker-20260822-062411-b1278emain-sandcastle-worker-20260826-165443-0e7e57main-sandcastle-worker-20260902-061548-44f3fbEach one reds the whole run:
stage=sandcastle run (workers) exit=1,HookTimeoutError. The 2026-09-02 case is run 16298, healer signatureac1ad13c44bf. That it is never the first install of a cold store, and thatiteration 1 of the same run greens in ~20 s, rules out a broken lockfile or a
cold store (GOTCHAS #20/#489 already guard that) — this is a slow install
against a warm store, killed mid-flight.
Why the healer could not fix it
.sandcastle/main.mtsis BOTH a protected path (protected-paths-lib.sh) andvendored byte-identical from
Matou/dev-factory(FACTORY_MANIFEST:31,FACTORY_REF9f4dfc6).check-harness-drift.shcurrently reports OK; anylocal edit turns it red. So does
provision-lib.sh,run-swarm.shandswarm.config— there is no in-repo surface for this fix.Acceptance
timeoutMsupstream inMatou/dev-factory, sized to cover the observed 46.5 s max with real marginwhile still catching a genuine hang — suggest 300000 (5 min), ~6x the
observed max (cf. 58512e28's ceiling-sizing rule: worst case + margin, not a
round number by accident). An automatic retry of the hook is an acceptable
alternative or addition.
FACTORY_REFbumped here andcheck-harness-drift.shgreen. (It is already3 commits behind upstream main — bump together.)
docs/GOTCHAS.mdentry: SymptomHookTimeoutError: Hook 'CI=true pnpm install ...' timed out after 60000ms; Cause a lifecycle ceiling only 1.3xabove the observed install max on a contended host; Rule size a sandbox
lifecycle ceiling off the measured right tail, not the library default.
Filed by the swarm healer from
/tmp/matou-heal-Matou-idss.Dtqgbo(
run-verdict.txt,worker-logs.txt,host.txt).Ruled by agent under ADR 0174 — veto anytime. Two-way door: a revertible config change (a timeout ceiling raised, not a security widening) on the swarm harness, provable by
check-harness-drift.shgoing green on the new pin and by the setup hook now carrying the explicit ceiling. Nothing on the one-way-door list touched.Close report — landed and proven
Root fix (upstream, where the file is owned).
.sandcastle/main.mtsis vendored byte-identical fromMatou/dev-factoryand is a protected path, so there is no in-repo surface for the fix. Landed it upstream:4cd0d57— theonSandboxReadypnpm-install hook now carries an explicittimeoutMs: 300_000(5 min). That is ~6x the observed 46.5 s warm-store install max — real margin for a contended host while still catching a genuine hang — instead of inheriting Sandcastle's 60 000 ms per-command default (only 1.3x above the observed max). Syntax-validated against the pinned@ai-hero/sandcastle@0.12.0type (onSandboxReady[].timeoutMs?: number,dist/index.d.ts:286-289).Pin bump + re-vendor here.
54aa744b—FACTORY_REF9f4dfc6→4cd0d57, re-vendored via the canonicalonboard.sh vendor(updated:main.mts, plushost-capacity-lib.sh+ its test, the 3 intervening factory commits idss was behind — bumped together as the ticket asked).check-harness-drift.sh→ OK (was 3 behind; now on tip).host-capacity-lib-test.sh24/24 green.HookTimeoutError: Hook 'CI=true pnpm install …' timed out after 60000ms; Cause a lifecycle ceiling only 1.3x above the observed install max on a contended host; Rule — size a sandbox lifecycle ceiling off the measured right tail, not the library default.Acceptance 1/2/3 all met. Commits: dev-factory
4cd0d57, idss54aa744b.Note for the next healer of this signature: the change reaches the WORKERS at the next
.sandcastlevendor already on main — no droplet or image rebuild involved. If a 60000msHookTimeoutErrorstill appears in a worker log dated after this pin landed, it means that checkout had not yet pulled54aa744b, not that the ceiling failed.rehearsal-report.shdrifted - bdb42ff6’s token-leak fix must land in dev-factory (which still leaks) and ride back on a FACTORY_REF bump #1683