swarm loop stalls green: runs conclude 'success' with a ready ticket unworked and no worker spawned — log every run-swarm exit reason host-side, then fix the wedge #435
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#435
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?
Symptom — two stall windows in 24h, ~10 hours of loop time lost
Twice now the ourcloud swarm has gone hours with a ready ticket sitting untouched while
swarm.ymlruns completed "success" on cadence:swarm.ymlat 13:30 and 14:15 (plus the cron's own 15,45 firings all day), every run concluded "success",docker eventsduring a live-watched dispatch showed no container created, zero comments/claims on #432. A manualworkflow_dispatchat 14:35 broke the spell — that run spawned a worker within a minute and is working #432 normally.Eliminated (checked live during the second window)
fuser /tmp/matou-swarm.lockempty between runs; last night's holder was a legitimate 2h #424 worker).list-ready-tasks.shwith the real token returns[#432]in <1s; with a bogus token it fails loud (rc=22), which underset -euo pipefail+ the verdict trap would red the job — daytime runs were green.SWARM_DEBOUNCE=600— the 30–45min dispatch cadence sails past it./tmp/matou-swarm-claude-limitmtime is 2026-08-02, far beyondCLAUDE_LIMIT_TTL=3600→claude_limit_parkedreturns false.What plugging it needs
.sandcastle/run-swarm.sh— "no ready tasks", coalesce, limit-pause, each verdict_stage failure, normal completion — appends ONE line to a host-side log (e.g.~/swarm/logs/run-swarm-verdicts.log): timestamp, repo, ready-set numbers, exit reason, duration. The two stall windows were archaeology precisely because a green no-op run leaves no host-side trace. (The job log has it, but the actions REST API hangs intermittently — from the laptop constantly, from the workstation sporadically — so job logs are not a dependable forensic path.)Context: both stalls gated the #183 rehearsal ratchet (the drive issue's blockers sat ready for hours), but the defect is loop infrastructure, not rehearsal-specific.
Landed in
9a123a3onmain. Two durable halves — instrument first, then plug the wedge.1. Host-side exit log (the durable deliverable). New
.sandcastle/runlog-lib.sh;run-swarm.shsources it and, via its existing EXIT trap, appends ONE line at EVERY exit path —no-ready-tasks,coalesced,claude-limit-parked, eachset -estage death (died-in:<stage>), the green wedge (no-worker-spawned), and normalcompleted— to~/swarm/logs/run-swarm-verdicts.log(override withSWARM_RUNLOG):UTC-timestamp repo=… ready=[nums] reason=… exit=… duration=…s. A green no-op now leaves a trace on disk, so the next stall is readable without the Actions REST API.2. Fix the wedge (never green-and-empty again). A live
docker events --since <run-start> --filter event=createstream watches for worker births for the whole run. Sandcastle starts each iteration's worker asdocker run -d --name sandcastle-<uuid>(verified against@ai-hero/sandcastle's docker sandbox), so a create event namedsandcastle-*is proof a worker spawned. If a non-empty ready set concludes success (exit 0) with ZERO worker births — never legitimate, even a blocked task spawns a container — the run fails LOUD: red job + ano-worker-spawnedverdict the healer keys a fresh signature on + a:rotating_light:Mattermost post. And per the issue's own hint: any run that wrote a fresh debounce stamp but never confirmed a worker (quiet death, green wedge, limit park, sandcastle failure) clears the stamp on exit, so a stale stamp can't coalesce away the very next genuine retry; the coalesce path keeps its stamp, so burst-debouncing still works.Guards: docker-unavailable skips the wedge check (never false-fails — and a run that got this far already needed docker for build/run); the
--sincereplay closes the stream-attach startup race; thesandcastle-name filter keeps the unnamed nix-seed containers out.Tests: new
.sandcastle/tests/runlog-lib-test.sh(line format incl. ready-set numbers/duration, append-never-fails-the-caller, and theworker_wedgepredicate across all four cases).bash -n+debounce-test.shstill green.Root-cause (issue step 2) left open, honestly. Reading the specific 13:30Z/14:15Z 2026-08-11 run logs to name which exit path they took needs the Actions job logs — not reachable from the worker sandbox (and the REST API hangs, which is exactly why this ticket exists). The fix above is robust regardless of which path those runs took: any green-and-empty run is now loud, and the stamp can't wedge a retry. The instrumentation is precisely what will capture the discriminator (exit reason + worker-birth count) on disk the next time it happens. If a human can pull those two run logs from the Forgejo web UI, the
reason=this code now emits is the same discriminator, retrofit-readable.STATUS.md header + milestone log updated in the same commit.