Skip to content

Record requeue source in attempt results and count automatic continuations #201

Closed

Description

@lbacik

What to build

Every attempt-result comment records how its implementation attempt was requeued: by a human (the issue carried ready-for-agent at claim time) or automatically (the issue carried only round-finished at claim time). From an issue's comment history, the tracker can then tell how many automatic continuations the issue has had in a row since its last human requeue.

This is groundwork for automatic continuation of round-finished issues. It does not change the runnable queue yet: today every claim is a human requeue, so every new comment records "human".

Design decisions:

  • The requeue source is a hidden HTML marker in the attempt-result comment, next to the existing <!-- agent-attempt: <started_at> --> marker. The count lives on GitHub, not in local state, so it survives restarts.
  • Only comments written by the agent's own GitHub identity count. Any other comment is ignored, even if it contains the marker.
  • The count is the number of automatic-requeue result comments in a row, starting from the newest, up to the most recent human-requeue result comment. A human requeue resets it to zero.
  • Result comments written before this change have no requeue marker and count as human requeues. An issue with old history therefore starts at zero.
  • The requeue source is decided once, from the claim snapshot (the labels the issue had before claiming removed round-finished), so the comment reflects the actual reason for the claim.

Acceptance criteria

  • Every attempt-result comment the agent posts (all attempt outcomes, including recovery/emergency paths that post results) carries a requeue-source marker: human or automatic
  • The requeue source is derived from the claim snapshot's labels: ready-for-agent present means human, otherwise automatic
  • The tracker exposes the automatic-continuation count for an issue, computed only from the agent's own comments
  • Count semantics are covered by tests: no history returns 0; only legacy unmarked comments return 0; human, auto, auto returns 2; auto, human returns 0; markers in other users' comments are ignored
  • The runnable queue, next issue validation and the release sequence behave exactly as before
  • CONTEXT.md defines Automatic continuation (an implementation attempt claimed from round-finished without a human requeue) and the requeue source it is counted by

Blocked by

None (can start immediately).

Activity

  1. added
    ready-for-agentFully specified implementation issue ready for an unattended agent
    on Oct 11, 2026
  2. self-assigned this
    on Oct 11, 2026
  3. lbacik commented on Oct 11, 2026

    @lbacik
    OwnerAuthor

    Agent Attempt Result: handoff

    Branch: agent/issue-201
    PR: none
    Handoff note commit: c6c2c0e4705efc94e5ecce21b2602ef608e7c348

    Evidence

    • Check command: 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 None
    • Review cycles: 0/2
    • Review findings: all clear

    Details

    Handoff note: issue #201

    • issue: 201
    • started_at: 2026-10-11T00:00:00Z
    • reason: token_soft_threshold
    • last_work_commit: b0f5044

    Summary

    The requeue-source groundwork spec is fully implemented and committed as
    b0f5044 on agent/issue-201. Every attempt-result comment now carries a
    hidden <!-- requeue-source: human|automatic --> marker next to the
    <!-- agent-attempt: … --> marker (normal publication for all outcomes
    plus the recovery-release path); the source is decided once from the claim
    snapshot and stored on the attempt checkpoint so recovery keeps the
    claim-time decision; and GitHubTracker.automatic_continuation_count()
    counts automatic-requeue results in a row from the agent's own comments,
    treating legacy unmarked results as human requeues. CONTEXT.md defines
    Automatic continuation and Requeue source. Full suite: 896 passed,
    9 skipped; ruff check passes. An inline code review (Standards + Spec)
    found no violations or scope creep; the parallel review sub-agents could
    not be launched (token soft threshold).

    Remaining work

    • None for this spec: all six acceptance criteria are implemented, tested,
      reviewed inline, and committed. A continuation only needs to publish:
      push the branch, open the PR, and post results per the driving process.
    • Optional follow-up (not in spec): the ("human", "automatic") literal is
      repeated in recovery.py and attempt_state.py to keep attempt_state
      dependency-free; a shared constant could be introduced if the team prefers.

    Evidence

    • Commit b0f5044: 11 files, +543/−5 (git show b0f5044 --stat).
    • New tests: tests/test_requeue_source.py (claim-snapshot semantics,
      recovery-retry keeps claim-time source); count semantics in
      tests/test_github_tracker.py; marker tests in tests/test_publication.py
      and tests/test_recovery.py; checkpoint tests in
      tests/test_attempt_state.py.
    • Key files: simple_coding_agent/recovery.py (marker helpers + counting),
      simple_coding_agent/publication.py (PublicationRequest.requeue_source),
      simple_coding_agent/attempt_state.py (checkpoint field),
      simple_coding_agent/lifecycle.py (thread-through at all 7 publish sites),
      simple_coding_agent/github_tracker.py
      (automatic_continuation_count), CONTEXT.md (definitions).
  4. added
    round-finishedAgent round finished; requires human evaluation to continue
    and removed
    ready-for-agentFully specified implementation issue ready for an unattended agent
    on Oct 11, 2026
  5. removed their assignment
    on Oct 11, 2026
  6. added
    ready-for-agentFully specified implementation issue ready for an unattended agent
    on Oct 11, 2026
  7. self-assigned this
    on Oct 11, 2026
  8. removed
    round-finishedAgent round finished; requires human evaluation to continue
    on Oct 11, 2026
  9. added a commit that references this issue on Oct 11, 2026
  10. lbacik commented on Oct 11, 2026

    @lbacik
    OwnerAuthor

    Agent Attempt Result: complete

    Branch: agent/issue-201
    PR: #205

    Evidence

    • Check command: 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 0
    • Review cycles: 0/2
    • Review findings: all clear

    Details

    Claude SDK completed the implementation workflow.

  11. removed
    ready-for-agentFully specified implementation issue ready for an unattended agent
    on Oct 11, 2026
  12. removed their assignment
    on Oct 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions