Repository navigation
Auto-continue round-finished issues up to MAX_AUTO_CONTINUATIONS #202
Description
What to build
An operator setting, MAX_AUTO_CONTINUATIONS, lets the agent pick up round-finished issues on its own, with no human requeue, up to N automatic continuations in a row. A human requeue (re-applying ready-for-agent) resets the count and grants another N rounds. The default 0 keeps today's behaviour: continuing after a handoff always needs a human decision.
Eligibility
An issue is eligible for automatic continuation when all of these hold:
- it carries
round-finishedand notready-for-agent - it is open and unassigned, has a non-empty body and has no open native blockers (the same rules as the runnable queue)
- its automatic-continuation count (see the blocking ticket) is below
MAX_AUTO_CONTINUATIONS
Claiming works as it does today: assign, remove round-finished, and take the existing continuation path (restored branch, starting prompt enriched with the handoff note). Brakes that already exist stay in place:
- a handoff with zero commits becomes
no_changesand never re-addsround-finished, so the loop stops - a human can stop automatic continuation at any time by removing
round-finished
Ordering
Continuations go first. Issues eligible for automatic continuation are claimed before ordinary ready-for-agent issues, so a started branch doesn't wait behind new work. Within each group the order is FIFO by creation date. A ready-for-agent issue that is also a continuation (a human requeue after a handoff) stays in the ordinary group.
Operator-only setting
MAX_AUTO_CONTINUATIONS is read only from the operator's .env. The repository profile keeps rejecting unknown keys, for the same reason as ADR 0004: the profile lives in the target repository, so an agent-written PR could raise its own round limit. The value must be a non-negative integer; anything else fails at startup with a configuration error.
next issue priority
The operator next issue command uses the same eligibility rule. It accepts a round-finished target within budget. When the budget is used up, it rejects the target with a visible reason that names the limit, for example "automatic continuation limit reached (2/2)".
Handoff reporting
When MAX_AUTO_CONTINUATIONS > 0, every handoff result comment says where the issue stands, for example "automatic continuation 1/2 used; the agent will continue automatically". The handoff that uses up the budget says the issue now needs a human requeue. This text is written once, when the handoff is released, never on queue polls. Claiming an issue for automatic continuation emits an observability event (auto_continuation_claimed) with the issue number and the count.
Docs
- A new ADR records the policy change: continuing after a handoff no longer always needs a human, within an operator-set limit, with the reasoning and the brakes above.
- Operator onboarding ("Continuation requires a human decision"), the README, the triage-labels doc and
.env.exampledescribe the new setting and howround-finishedbehaves under it.
Acceptance criteria
-
MAX_AUTO_CONTINUATIONSis loaded from the environment (default0, non-negative integer, invalid values fail at startup), and the repository profile refuses it as a key - With
0, the runnable queue, claims,next issueand handoff comments behave exactly as before - With
N > 0, around-finishedissue whose automatic-continuation count is below N is in the runnable queue and gets claimed. Claiming removesround-finishedand starts the existing continuation path - With
N > 0, around-finishedissue whose count has reached N is not eligible and stays labelledround-finished - Issues eligible for automatic continuation are ordered before
ready-for-agentissues, FIFO by creation date within each group - Revalidation at claim time (
claim_nextandclaim_verified) applies the same rule, so an issue whose budget ran out, or that a human relabelled, between the queue read and the claim is skipped -
next issueaccepts around-finishedtarget within budget and rejects one past budget with a reason naming the limit (k/N) - With
N > 0, handoff result comments report the count (k/N), and the handoff that uses up the budget says a human requeue is needed - Claiming for automatic continuation emits an
auto_continuation_claimedevent - End-to-end test with N=2: an issue that keeps handing off is continued automatically twice and then waits. A human re-applying
ready-for-agentresets the count and allows two more automatic rounds - New ADR added. Onboarding, README, triage-labels doc and
.env.exampleupdated
Activity
lbacik commentedon Oct 11, 2026
Agent Attempt Result: handoff
Branch: agent/issue-202
PR: none
Handoff note commit:
74d961069cb80eb6ca360dfb14c8ef02e5482444Evidence
UV_PROJECT_ENVIRONMENT=/home/agent/venv-py311 uv run --python 3.11 --extra dev ruff check && UV_PROJECT_ENVIRONMENT=/home/agent/venv-py311 uv run --python 3.11 --extra dev pytest && UV_PROJECT_ENVIRONMENT=/home/agent/venv-py313 uv run --python 3.13 --extra dev pytest→ exit code NoneDetails
Handoff note: issue #202
Summary
Implemented the
MAX_AUTO_CONTINUATIONScore path (commit43b5f51onagent/issue-202, on top of #201's merged HEAD8d95b44).RuntimeConfiggains
max_auto_continuationsparsed from.envvia a new_non_negative_integerhelper (default 0; invalid values raiseConfigurationError); the repository profile still rejects it as an unknownkey.
GitHubTrackeraccepts the budget, exposesis_auto_continuation_eligible(zero budget short-circuits before anycomment reads), orders continuations before ordinary
ready-for-agentissues in
runnable_queue(FIFO within groups; human requeues stayordinary), and revalidates at claim time in
claim_nextwith a budget-awareineligibility_reason("automatic continuation limit reached (k/N)"whenexhausted).
AgentLifecyclethreads the budget throughsubmit_next_issueand
_claim_prioritized_locked, emitsauto_continuation_claimedon FIFOand priority automatic claims, and appends a standing line (
k/N, plus ahuman-requeue notice when the budget is exhausted) to handoff details once
at release — the publisher is untouched.
FakeTrackergainsauto_countsplus
automatic_continuation_count;__main__.pywires the settingend-to-end. Lint (
ruff check) is clean and the existing config/trackersuites pass (104 tests).
Remaining work
tests/test_auto_continuations.py: config defaults/validation +profile refusal; queue ordering (continuations first, FIFO within groups,
human-requeued stays ordinary);
claim_nextpicks in-budget / skipsover-budget (incl. claim-time relabel and count-change-between-reads);
next issueaccept within budget + reject over budget with(k/N);handoff comment lines (progress + exhausted) and silence at N=0;
auto_continuation_claimedon FIFO + priority claims; N=2 e2e (two autocontinuations then wait; human requeue grants two more). Key harnesses:
make_lifecycle/issue()intests/test_next_issue.py,FakeTransport/FakeCommentTransport/issue()intests/test_github_tracker.py, marker helpers insimple_coding_agent/recovery.py(requeue-source: human|automatic),_claim_prioritized_lockedsemantics atlifecycle.py:2869.docs/adr/0005-*.md; updatedocs/agents/operator-onboarding.md,README.md,docs/agents/triage-labels.md,.env.example./code-review,address findings, and commit (with
Co-Authored-By: Claude Code <noreply@anthropic.com>trailer) onagent/issue-202.Evidence
43b5f51(5 files, +267/-24):simple_coding_agent/config.py,github_tracker.py,lifecycle.py,__main__.py,tests/fakes.py./home/agent/.claude/projects/-data-repo/ce15b452-2e76-4739-b989-575fbcb9c956.jsonlruff check simple_coding_agent/ tests/fakes.pyclean;pytest tests/test_config.py tests/test_github_tracker.py→ 104 passed.READY_FOR_AGENTimport in
lifecycle.py(ruff F401).Handoff note: issue #202
Seal attempt work for #202 (succeeded)
lbacik commentedon Oct 11, 2026
Agent Attempt Result: complete
Branch: agent/issue-202
PR: #210
Evidence
UV_PROJECT_ENVIRONMENT=/home/agent/venv-py311 uv run --python 3.11 --extra dev ruff check && UV_PROJECT_ENVIRONMENT=/home/agent/venv-py311 uv run --python 3.11 --extra dev pytest && UV_PROJECT_ENVIRONMENT=/home/agent/venv-py313 uv run --python 3.13 --extra dev pytest→ exit code 0Details
Claude SDK completed the implementation workflow.