Skip to content

Failure limit: Pickup counts agent-failed issues, not Claims - #1585

Merged
JacobStephens2 merged 4 commits into
issue-1564from
issue-1569
Oct 29, 2026
Merged

JacobStephens2 merged 4 commits into
issue-1564from
issue-1569

Conversation

@JacobStephens2

@JacobStephens2 JacobStephens2 commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

Closes #1569

Summary

A Pickup run no longer counts Claims. It counts the issues the factory failed on, up to the Failure limit (pickup.failure_limit, default 3). A pull request waiting for review never counts. See ADR 0026.

 Claim::end(ending)                       # claim::Ending: Reached | NotReproduced | Held | Failed
   NotReproduced -> needs-info            (even after a Stop, as before)
   stopped       -> triage / requeue      (no agent-failed)
   Reached / Held -> Claim stays          (no agent-failed)
-  Failed        -> release if nothing on origin
+  Failed        -> release if nothing on origin, else label agent-failed
+                   (a failed Security fix: always label)

 pickup gates
   lock
-  sweep in-progress off closed issues
-  skip at pickup.limit open in-progress issues
+  sweep in-progress and agent-failed off closed issues
+  take agent-failed off issues the Day shift handed back (ready-for-agent)
+    or took over (no in-progress, no needs-triage); don't count them
+  skip at pickup.failure_limit open agent-failed issues
   Ready issue search
  • Making a Claim takes agent-failed off.
  • Labelling finishes after Ctrl-C, and a missing label is created on the repository.
  • pickup.limit is accepted and ignored, with a warning naming pickup.failure_limit:
    • every Command prints it on stderr, quiet skips included;
    • the Activity log records it once per change, as User config warning: ….
  • Setup and the User config defaults, the guide (regenerated site/docs/index.html), README, GLOSSARY, docs/code-navigation.md, and the hand-written pages (site/index.html, site/how-it-works/, site/architecture/) now say Failure limit.
  • ADR 0009 points to ADR 0026, which supersedes its "one unattended run per repository" sentence.

Decisions:

Evidence

  • Before: a repository with 3 pull requests waiting for review was skipped with at the Claim limit. A failed run left only in-progress.
    After: a CLI test against the fake gh, in tests/pickup_run.rs:
    a_failure_limit_skip_names_every_failure_lowest_first_without_extra_github_requests
      open issues #953, #924, #936 labelled agent-failed; default failure_limit
      thirdshift pickup
        -> gh: CI read, closed in-progress, closed agent-failed, open agent-failed (no Ready search)
        -> exit 0, stdout empty
        -> "at the Failure limit on acme/widgets: #924, #936 and #953 are labelled agent-failed, pickup.failure_limit is 3"
    
    Claims whose pull requests are ready, draft or merged never count. A handed-back or taken-over issue has agent-failed taken off and is not counted.
  • tests/failed_run.rs:
    • a failed run that pushed ends with ["in-progress", "agent-failed"], even when interrupted;
    • re-Claiming takes the label off.
  • Expectations changed in architect_run, continuation, process, security_run and pickup_run to include agent-failed.
  • Review P1, before the fix:
    quiet_skips = true, [pickup] limit = 10; thirdshift pickup
      -> stderr: ""
    
    After: stderr contains warning: pickup.limit is ignored… once. Tests: an_ignored_pickup_limit_is_warned_of_on_stderr_even_by_a_quiet_skip and with_quiet_skips_a_pass_that_works_prints_an_ignored_pickup_limit_once_and_logs_it.
  • Local runs on the final head:
    • Integration tests pass: activity_log 16, pickup_run 108, failed_run 15, process 150, bug_run 14, stop 10, merge_run 40, continuation 9, security_run 123, architect_run 91, user_config 18.
    • Unit tests for claim, pickup, run, labels, logs, processes and delivery pass (286).
    • cargo clippy --all-targets is clean. npm run docs:check --prefix site exits 0.
  • scripts/affected-tests main stopped at its first step, the site browser tests (see below), so its Rust steps were run by hand on the final head:
    • share_card, site_deploy, prompts_page and cargo build --locked pass.
    • cargo test --no-fail-fast passes everything except environment failures outside this change:
      • socat is not on PATH, which voids every sandboxed Trial (sandbox::tests, trial, experiments, scoring, and a bug_origins Codex limit test);
      • Python without tomllib (bug_origins settlement);
      • one console scoring test that fails on lock timing under load and passes alone.
  • Site browser tests couldn't run locally: Playwright's chromium isn't installed, and /opt/playwright isn't writable. CI runs them.

Merge Danger

Door: two-way

There is no data migration. The only GitHub change is a new agent-failed label, which is created on first use and is harmless to leave.

Blast Radius: scheduling

  • Pickup now keeps taking Ready issues while pull requests wait for review. That is the intent, but scheduled passes will start more work than before.
  • Existing User configs with pickup.limit keep working, with a warning.
  • Issues that failed before this change carry no agent-failed, so they don't count until they fail again.

Unaddressed findings

Standards

  • S6, "acted_on returns strings (Primitive Obsession)": declined. acted_on in src/pickup.rs has one call site, and its two strings are the step wording that tests assert. An enum would add a type without removing any duplication.
  • S8, second half, "FailedRun::held and failed_run::is_hold name one predicate twice": declined. run.rs holds a FailedRun and asks held(), and delivery.rs holds an anyhow::Error and asks is_hold. The first half, the full-path call, is fixed.

Spec

  • P2, "a failed Custom process now labels its issue agent-failed": declined because the Spec or the Day shift must decide it. Filed as Failure limit: should a failed Custom process run label its issue agent-failed? #1583 (needs-triage).
    • Evidence: src/processes.rs, HeldClaim::end(claim::Ending::Failed), and the tests/process.rs expectation ["in-progress", "agent-failed"].
    • The current behaviour is documented under "The Failure limit" in the guide.

All other findings (S1–S5, S7, S9, P1, P3) were fixed.

Security review outcome

No unaddressed introduced findings.

Review coverage

  • Excluded as generated: site/docs/index.html.
    • Source: docs/guide.md. Generator: site/generate-docs.mjs, unchanged.
    • npm run docs:check --prefix site exits 0. Both reviewers confirmed the exclusion.
  • Changed after review, not re-read by a reviewer:
    • src/labels.rs: the new helper labels::joined, for S4.
    • tests/stop.rs and tests/merge_run.rs: comments only, for P3.
  • Every other changed file was read by both reviewers.

Built with claude 2.1.312 · claude-opus-5-5 · high

A Failed ticket run or Failed spec run that keeps its Claim labels its
issue agent-failed, whatever started it; a held Self-merge, a Stop, a
released Claim and a needs-info ending add nothing. A Pickup run counts
open agent-failed issues against pickup.failure_limit (default 3),
after taking the label off issues the Day shift handed back or took
over; the Sweep clears it from closed issues and the next Claim takes it
off. Pull requests waiting for review no longer hold Pickup back.

An old pickup.limit is accepted and ignored, with a warning on stderr
naming pickup.failure_limit, recorded in the Activity log once per
change. ADR 0026 records the decision.

Closes #1569
- Quiet skips still print a User config warning, such as an ignored
  pickup.limit, on stderr, once.
- Every Claim ending goes through Claim::end; HeldClaim ends with an
  Ending, and a bug not reproduced ends with needs-info even after a Stop.
- Share labels::joined, name pickup's clear_and_count_failures, and
  bind the Claim-stays result where it is read.
- ADR 0026 and the glossary: taking over leaves no needs-triage, and a
  failed release gets no agent-failed. The guide notes Custom processes
  (#1583).
Brings in #1570: Pickup moves on to the next Ready issue when it loses
a reservation. Resolved against the Failure limit:

- src/pickup.rs: the module doc keeps both the agent-failed clearing and
  the search past unreservable issues; AtFailureLimit uses the shared
  write_numbers helper; #1570's tests expect the Failure limit gate's
  calls (CLOSED, CLOSED_FAILED, FAILED) in place of the Claim limit's.
- docs/guide.md, site/docs/index.html: the skip paragraph takes #1570's
  wording for reserved or stale selections, with the Failure limit.
Brings in the Command limit (#1571, pass.command_limit) alongside this
branch's Failure limit. Conflicts kept both: UserConfig carries
pickup_failure_limit and command_limit, the ignored pickup.limit warning
sits beside the pass.command_limit parser, and each side's tests stay.
The guide, code navigation and generated site docs now say a Pass takes
a slot at the Command limit, then counts agent-failed issues against the
Failure limit, with no Claim limit left.
@JacobStephens2
JacobStephens2 merged commit a2900b2 into issue-1564 Oct 29, 2026
18 checks passed
@JacobStephens2
JacobStephens2 deleted the issue-1569 branch October 29, 2026 03:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant