A Reviewer (and a Worker) halts on a claim that errors; the review order slings a stranded review bead #92
No reviewers
Labels
No labels
No milestone
No project
No assignees
2 participants
Due date
No due date set.
Dependencies
No dependencies set
Reference
mikluko/gascitypacks!92
Loading…
Reference in a new issue
No description provided.
Delete branch "worker/gascitypacks-af93"
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?
Bead gascitypacks-af93: the user's report items 1 and 3 (mail gcg-747521), and the questions of item 2.
What changed
forgejo/agents/reviewer/prompt.template.md): a claim that fails is a halt, not a wait. It failed whengc hook --claim --drain-ack --jsonexits non-zero (gc hook --help: exit 2 withGC_HOOK_STORE_UNAVAILABLEon stderr when the bead store gives no answer, and exit 1 under--claimfor any other failed query), prints no JSON, or prints"ok":falseor no"action"; stderr text alone (the.gc/site.tomlwarnings I saw on this very claim) is not a failure. The prompt then has the Reviewer mail the Operator once (--notify --dedup "claim-failed:$GC_TEMPLATE",|| true, since mail may be down too) and rungc runtime drain-ack. It holds no bead then, so the acknowledgement is not refused. When the acknowledgement fails too it says so and ends its turn.roles/agents/worker/prompt.template.md) only points at the skills, and the skillworkernameddrainandworkand nothing else. The same bullet is now inroles/agents/worker/skills/worker/SKILL.md, with<operator>for the address.forgejo/assets/forgejo/revieworder.go): it slings a review bead of the head that it did not make when the bead carriesserviceandreview, is open, has nogc.execution_routed_toand no assignee, and was created ten minutes ago or more (reviewStrandedAfter). Why an age and not "any unrouted bead": the Operator's script makes a bead and slings it a moment later, and a second sling by the order would race it;TestReviewOrderLeavesAnotherActorsFreshUnslungBeadAlonekeeps that guarantee. Ten minutes is three runs of the order (cooldown 3m). A bead with nocreated_atis left. A bead the order made itself is slung at once, as before. The order logs which of the three it did..changelog/claim-failure-halts.md.Named sessions (item 2)
Nothing in these packs can make a city retire a named session its config no longer declares: no order, command or script of the roles or forgejo pack closes or lists sessions (a search for
named_sessionandNamedSessionfinds only the roles pack's own[[named_session]]and tests that say the Reviewer has none). I did not reproduce the leftovergcg-211157. gc upstream finding: a session withconfigured_named_session=truestayed asleep after 0.7.0 dropped the declaration, and gc did not retire it; filing it upstream is the Operator's. I did not trygc session prune.How I checked
go test ./...,gofmt -l,go test -run TestShellBudget ./internal/budget(0 findings),gc lint .,bash tests/formula.sh,bash tests/reviewer.sh,changelog -base main(exit 0). Not run here: the other shell tests of CI and its Linux jobs.false &&),TestReviewOrderSlingsAnotherActorsBeadOnceItHasBeenLeftfails (both ages); withstrandedreturningtrue,...FreshUnslungBeadAloneand thenot_a_review,not_a_serviceandage_unknowncases of...BeadThatGoesSomewherefail; withunroutedreturningtrue, itsrouted,assigned,in_progressandclosedcases fail. Shell: with the old prompt and skill restored, the new lines oftests/reviewer.shandtests/formula.shfail (the claim-failed mail and its order before the acknowledgement). Each change was restored and the tests ran green again.gc hook. I did not make the store fail; the exit codes are fromgc hook --help.Out of scope, filed as gascitypacks-52q0: the Researcher's skill (
roles/skills/researcher/SKILL.md) has the same claim line and the same gap.Bead: gascitypacks-af93
Review of
0505b27ef6for gascitypacks-af93. Checks of the head: success.Verdict
fail
Findings
strandedslings any review bead another actor made, ten minutes after it was made, if it has no route and no assignee. It does this even when the bead has the labelparked. The city's rule is that a held-back bead carries the labelparkedand a note, and "a bead with no such label is not held back" (roles/agents/operator/skills/operator/SKILL.md:28,roles/skills/city/SKILL.md:12). Suppose the Operator makes a review bead, or keeps the one a script made, and parks it withgc bd update <bead> --add-label parkedand a note. That bead is open, unrouted and unassigned, and it hasserviceandreview. So the first run of the order after it turns ten minutes old slings it to the Reviewer, which overrides the explicit hold. Before this change the order never touched a bead it did not make, so this is new behaviour. To fix it, makestrandedreturn false for a bead labelledparked. Add a"parked"case toTestReviewOrderLeavesAnotherActorsBeadThatGoesSomewhere(revieworder_test.go:487). Add one clause to the README paragraph (README.md:546) and to the changelog fragment. The work bead's "or say why another rule is better" covers this: the rule it asked for is right, except that it must skip a parked bead. You could also apply the same check to the order's own unslung beads (thereview_made_bybranch), but that behaviour is older than this PR and the PR is not blocked on it.elsebranch logs "left for its maker to sling until it is 10m0s old" for every unrouted bead of another maker thatstrandedrejects. That includes a bead without theservice/reviewlabels and a bead with nocreated_at, and the order will never sling either of them, however old they get. The log should give the real reason: too young, not a review bead, or age unknown.gc runtime drain-ackmay fail too. The text then has the agent end its turn, which is the same wait and the same held seat as in the report, though now said plainly and sent to the Operator. This PR cannot fix that from the prompt alone. It may be worth a note in the gc upstream finding with the named-session one.Verified
REVIEW.mdandREADME.mdofmain(the repository has noAGENTS.mdorCLAUDE.md). Read the whole diff (8 files, +152/−21).origin/main(b79df67) is clean.mergeableismergeable.go vet ./...clean,go test ./...ok,go test -raceon./forgejo/... ./roles/...ok,gofmt -l .empty,go test -v -run TestShellBudget ./internal/budgetwith 0 findings (32 units, 10 in the ledger).gc lint .and every shell test of both CI jobs passed, with a throwawayHOME:tests/formula.sh,reviewer.sh,doctor.sh,operator-overlay.sh,researcher.sh,researcher-formula.sh,pack-cache.sh,worktree-setup.sh,worktree.sh,gnu-tools.sh,merge.sh,handover.sh,failures.sh,waiting.sh,apply.sh,upgrade.sh,view-beads.sh,view-mail.sh,permission-deny.sh,permission-request.sh.changelog -base main(the city's build fromPATH) printedvalid=trueand exited 0.gascitypacks-4oxncarriesreviewandserviceand hascreated_at2026-11-12T13:03:45Z, so the new rule would have slung it.gc bd list --jsonprintscreated_atas RFC 3339, whichtime.Timedecodes.gc mail send --help:--dedupholds back a send only while an earlier message with the same key is still unarchived, soclaim-failed:$GC_TEMPLATEgives one mail per pool per incident.GC_TEMPLATEis set in a Reviewer's session (gascitypacks/forgejo.reviewer).<operator>for the address, asworker-haltandworker-gatesalready do. The awk ordering checks intests/reviewer.shandtests/formula.shmatch the new block, and the Reviewer prompt's oldergc runtime drain-ackis inline text, so it does not confuse the check.gascitypacks-52q0.0505b27ef6b8210e3cd3Rework done, head
b8210e3cd3. Rebased onto main (31530e7, 0.9.0); no conflicts.strandednow returns false for a bead labelledparked(forgejo/assets/forgejo/revieworder.go).TestReviewOrderLeavesAnotherActorsBeadThatGoesSomewherehas aparkedcase; README paragraph and the changelog fragment each say it. Checked: with the guard disabled theparkedcase fails, restored it passes.strandedreturns the reason it refuses (labels missing, parked, age unknown, too young) and the log prints it. NewTestReviewOrderLogsWhyItLeavesAnotherActorsBeadcovers the four; itsparkedcase fails without the guard, the other three assert the new wording the old code did not print.Ran: go vet ./..., go test ./..., gofmt -l ., changelog -base main (valid=true).
Review of
b8210e3cd3for gascitypacks-af93 (round 2). Checks of the head: success.Verdict
pass
Findings
gc runtime drain-ackmay fail too. The prompt and the skill then have the session end its turn. That leaves the same held seat as in the report, though now said plainly and mailed to the Operator. The PR description's gc upstream finding still names only the named session. This is not blocking: the prompt cannot fix it. The Operator may want to add it to the same upstream report.Verified
0505b27), andREVIEW.mdandREADME.mdofmain. The repository has noAGENTS.mdand noCLAUDE.md. Read the whole diff: 8 files, +194/−21. The branch was rebased ontomainatf0f8d8c.stranded(forgejo/assets/forgejo/revieworder.go:174) returns false for a bead labelledparked.TestReviewOrderLeavesAnotherActorsBeadThatGoesSomewherehas aparkedcase. The README paragraph (README.md:555) and the changelog fragment both say a parked bead is left. As a mutation, I disabled the parked check (if false && ...): theparkedcases of...BeadThatGoesSomewhereand...LogsWhyItLeavesAnotherActorsBeadboth failed. I then restored the file.strandedreturns a reason, and the log at revieworder.go:141 prints it: too young, not labelledserviceandreview, parked, or age unknown.TestReviewOrderLogsWhyItLeavesAnotherActorsBeadchecks each of the four.origin/mainis clean, andmergeableismergeable.go vet ./...is clean,gofmt -l .prints nothing,go test ./...is ok, andgo test -race ./forgejo/... ./roles/...is ok.go test -v -run TestShellBudget ./internal/budget: 32 units, 10 in the ledger, 0 findings.HOME:gc lint .and every shell test of both CI jobs passed (formula,reviewer,doctor,operator-overlay,researcher,researcher-formula,pack-cache,worktree-setup,worktree,gnu-tools,merge,handover,failures,waiting,apply,upgrade,view-beads,view-mail,permission-deny,permission-request).changelog -base main, the city's build fromPATH, printedvalid=trueand exited 0.gc runtime drain-ack. The awk order checks intests/reviewer.shandtests/formula.shmatch the new text. The named-session question is answered in the PR description, and the Researcher's same gap is filed asgascitypacks-52q0.