A limit-parked swarm run still claims+releases every ready ticket — each agent-working toggle is an issues event that queues another run (2,700 queued no-op runs across four repos, 2026-08-26) #103

Closed
opened 2026-08-26 20:17:37 +00:00 by matou-build-agent · 2 comments

Symptom (2026-08-26): status=waiting Actions runs: dev-factory 924, idss 1469, matou-app 179, matou-website 145. dev-factory swarm.yml fired 785 times in one day, one every ~16 s, every one event: issues ending no-ready-tasks after 11 s. Tickets #91–#94 each carry 526–592 agent-working label events for the day (vs 2 ready-for-agent).

Cause: while Claude is limit-parked every swarm run still runs the sandcastle loop, which claims each ready ticket (claim_mark_working POSTs agent-working), gets the refusal, and claim_releases it (DELETE). Forgejo sends BOTH label add and remove as issues action label_updated, and its workflow matcher maps that onto types: [labeled]. The job-level guard github.event.action != labeled || github.event.label.name == ready-for-agent therefore passes for every label change (action is label_updated, never labeled; the payload carries no label at all). Every parked run over N ready tickets queues ≥N successors under the per-repo concurrency group (cancel-in-progress false ⇒ nothing is ever dropped), each of which repeats the claim/release. Geometric until the park lifts; the queue then drains serially at one no-op per ~16 s per repo for hours, holding a runner slot per repo.

Fix:

  1. run-swarm.sh: gate on claude_limit_parked right after the ready set is known — exit 0 claude-limit-parked BEFORE provision/notify/claim, so a parked host writes no labels at all.
  2. swarm.yml (+ template): drop labeled from issues.types; a label change cannot be filtered by which label changed on Forgejo, and the :15/:45 cron + D5 self-rearm already pick up newly readied tickets.
  3. GOTCHAS entry.

Consumers must apply (2) to their own .forgejo/workflows/swarm.yml at their next pin bump / template re-render.

**Symptom (2026-08-26):** `status=waiting` Actions runs: dev-factory 924, idss 1469, matou-app 179, matou-website 145. dev-factory swarm.yml fired 785 times in one day, one every ~16 s, every one `event: issues` ending `no-ready-tasks` after 11 s. Tickets #91–#94 each carry 526–592 `agent-working` label events for the day (vs 2 `ready-for-agent`). **Cause:** while Claude is limit-parked every swarm run still runs the sandcastle loop, which claims each ready ticket (`claim_mark_working` POSTs `agent-working`), gets the refusal, and `claim_release`s it (DELETE). Forgejo sends BOTH label add and remove as `issues` action `label_updated`, and its workflow matcher maps that onto `types: [labeled]`. The job-level guard `github.event.action != labeled || github.event.label.name == ready-for-agent` therefore passes for every label change (action is `label_updated`, never `labeled`; the payload carries no `label` at all). Every parked run over N ready tickets queues ≥N successors under the per-repo concurrency group (cancel-in-progress false ⇒ nothing is ever dropped), each of which repeats the claim/release. Geometric until the park lifts; the queue then drains serially at one no-op per ~16 s per repo for hours, holding a runner slot per repo. **Fix:** 1. `run-swarm.sh`: gate on `claude_limit_parked` right after the ready set is known — exit 0 `claude-limit-parked` BEFORE provision/notify/claim, so a parked host writes no labels at all. 2. `swarm.yml` (+ template): drop `labeled` from `issues.types`; a label change cannot be filtered by which label changed on Forgejo, and the :15/:45 cron + D5 self-rearm already pick up newly readied tickets. 3. GOTCHAS entry. Consumers must apply (2) to their own `.forgejo/workflows/swarm.yml` at their next pin bump / template re-render.
Author
Member

This was generated by AI during triage.

Ruled by agent under ADR 0174 — veto anytime.

Ruling: already implemented → closing as fixed (category bug). The three-part fix this issue specifies has fully landed on main (commit 54e8f55):

  1. run-swarm.sh limit-park gate — a claude_limit_parked check now exits 0 with reason claude-limit-parked before preflight/provision/claim, so a parked host writes nothing to the tracker (no list, no agent-working toggle).
  2. swarm.yml + template — both .forgejo/workflows/swarm.yml and onboarding/templates/workflows/swarm.yml.tmpl now trigger on issues: types: [closed] only; labeled is dropped, with the reasoning captured inline (a Forgejo label trigger cannot be narrowed by which label changed).
  3. GOTCHAS entry — GOTCHAS 32 records the hazard ("A tracker WRITE made while parked is a TRIGGER").

Coverage exists: tests/run-swarm-limit-park-gate-test.sh pins the parked-run-touches-nothing invariant.

Why this is a two-way door: closing-as-fixed is reverted by a reopen + label change, and the claim is provable by the landed code plus the named test. Nothing here is on the one-way-door list. The consumer-propagation note in the body (consumers pick up the swarm.yml trigger change at their next pin bump / template re-render) is handled by the normal pull-only vendor mechanism and does not keep this factory ticket open.

Closing as resolved.

> *This was generated by AI during triage.* **Ruled by agent under ADR 0174 — veto anytime.** **Ruling: already implemented → closing as fixed (category `bug`).** The three-part fix this issue specifies has fully landed on `main` (commit `54e8f55`): 1. **`run-swarm.sh` limit-park gate** — a `claude_limit_parked` check now exits `0` with reason `claude-limit-parked` *before* preflight/provision/claim, so a parked host writes nothing to the tracker (no list, no `agent-working` toggle). 2. **`swarm.yml` + template** — both `.forgejo/workflows/swarm.yml` and `onboarding/templates/workflows/swarm.yml.tmpl` now trigger on `issues: types: [closed]` only; `labeled` is dropped, with the reasoning captured inline (a Forgejo label trigger cannot be narrowed by which label changed). 3. **GOTCHAS entry** — GOTCHAS 32 records the hazard ("A tracker WRITE made while parked is a TRIGGER"). Coverage exists: `tests/run-swarm-limit-park-gate-test.sh` pins the parked-run-touches-nothing invariant. **Why this is a two-way door:** closing-as-fixed is reverted by a reopen + label change, and the claim is provable by the landed code plus the named test. Nothing here is on the one-way-door list. The consumer-propagation note in the body (consumers pick up the `swarm.yml` trigger change at their next pin bump / template re-render) is handled by the normal pull-only vendor mechanism and does not keep this factory ticket open. Closing as resolved.
matou-build-agent 2026-08-26 22:43:50 +00:00
Author
Member

Landed: 54e8f55 (park gate in run-swarm.sh + test; swarm.yml/template on issues:closed only; GOTCHAS 32), self-copy pinned in 31d364d. Consumers: idss 590d40d9, matou-app 069b6c3, matou-website b4c1f5a. Queue purged from the forge DB: 2,365 waiting runs / 4,275 jobs cancelled, idss broker-deploy.yml and the 2 running runs kept; status=waiting now 0 across the four repos.

Landed: 54e8f55 (park gate in run-swarm.sh + test; swarm.yml/template on issues:closed only; GOTCHAS 32), self-copy pinned in 31d364d. Consumers: idss 590d40d9, matou-app 069b6c3, matou-website b4c1f5a. Queue purged from the forge DB: 2,365 waiting runs / 4,275 jobs cancelled, idss broker-deploy.yml and the 2 running runs kept; status=waiting now 0 across the four repos.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Matou/dev-factory#103
No description provided.