Skip to content

A Run doesn't notice when its Claim is taken off mid-Run, so a Pickup can start a second Run on the issue #1376

Open

Description

@JacobStephens2

This was generated by AI during triage.

Problem

A Run can't tell that its Claim has been taken off while it is still running. A Pickup pass then treats the issue as Ready and starts a second Run on it.

From #1373, on 2026-10-26:

No thirdshift code removed the Claim. Triage of #1373 checked the Claim code, the Pickup Sweep, the Console, the label-to-project workflow, the agent sessions on both hosts, and the issue events. The change came from a person, so this is a design question, not a defect.

Options to weigh

  • A Pickup pass skips a Ready issue that has a live Run in the Command records (on this host, or any host it can see), and doesn't start a second Run.
  • When the Issue worktree is already in use, the second Run fails with a message that names the live Run, not the raw git worktree add error.
  • A running Run checks for its Claim at stage boundaries and puts it back, or warns, when it is missing.
  • Leave it as it is: a person who changes labels during a Run owns the result.

Related: #1373 (its first half, Continuation reproduction, is being fixed there).

Activity

  1. added
    enhancement
    needs-triage
    on Oct 26, 2026
  2. added
    in-progress
    and removed
    needs-triage
    on Nov 10, 2026
  3. JacobStephens2 commented on Nov 10, 2026

    @JacobStephens2
    OwnerAuthor

    This was generated by AI during triage.

    Investigation summary

    Confirmed on selected Base commit 02c9654, which matches local main. The reported collision remains possible, although today's default Command limit prevents the same-host case.

    An isolated reproduction reused tests/support against real local git, fake GitHub and a fake Harness. It started a direct Continuation with an existing Issue branch, held its implementation session live, then simulated a Trusted operator removing its Claim and restoring ready-for-agent with corresponding label history.

    • With pass.command_limit = 1, Pickup exited 0 and skipped at the Command limit.
    • With pass.command_limit = 2, Pickup took the same issue, made another Claim and exited 1 because git worktree add found the Continuation's existing checkout. It added agent-failed while the original Continuation was still live.
    • Only one implementation session started in each case. The existing checkout and uncommitted work survived; both original Continuations subsequently completed successfully.

    Diagnosis and existing protections

    src/run.rs:214 and src/command_limit.rs:115 show that a direct Issue URL command takes a Command-limit slot but no issue origin reservation. Slots are stored under the account's HOME, so they do not provide cross-host exclusion.

    src/pickup.rs:199 reserves the selected issue on origin before refreshing readiness and dispatching. That protects reservation participants even if labels change. It cannot exclude a direct Continuation that holds no reservation. src/ready.rs:158 and standing_of at line 503 check labels, Claim history and other readiness gates without checking live Command records. A fresh selection after an explicit hand-back can therefore qualify while the original direct run is still live. Cross-host exposure follows from this code; it was not separately reproduced.

    Claim handling accepts an existing Claim and does not provide exclusive ownership. Automatically restoring a missing Claim would also change an intentional policy: src/claim.rs:1251 tests that failure cleanup leaves an operator's removed Claim alone.

    Occupied-checkout advice already exists in src/worktree/advice.rs and is covered by tests/continuation.rs:305. The reproduction received that advice, but it did not identify the live Command or distinguish its checkout from abandoned work.

    Recommended next steps

    Keep #1376 for a Day shift decision and propose separate Tickets for dispatch exclusion, live-Command diagnostics and missing-Claim behavior. Prefer extending atomic origin reservations to direct top-level issue runs over relying solely on observational Command-record checks. Such a change must explicitly amend ADR-0017, which currently exempts direct Issue URL commands, and preserve reservation inheritance for dispatched or child work.

    Do not automatically restore labels before deciding how deliberate operator edits should behave. Diagnostics can identify an owner independently of that policy.

    Related issues cover different concerns: #960 concerns competing runs drafting each other's pull request; #833 concerns exposing Claim ownership; #1068 concerns dispatch before successful Claim creation. None supersedes this reproduced direct-Continuation collision. #1373 is closed and addressed the separate bug-reproduction problem.

    This recommendation would add investigation evidence and the questionnaire to existing issue #1376 only. It proposes no immediate new issues or cross-issue comments.

    Questionnaire

    For the Day shift deciding #1376:

    Current Base still permits a Pickup collision after a live direct Continuation is manually relabelled Ready when the Command limit permits overlap. The default same-host limit prevents that case. Please decide:

    1. Should A Run doesn't notice when its Claim is taken off mid-Run, so a Pickup can start a second Run on the issue #1376 be split into three Tickets: (A) prevent competing dispatch on an issue already owned by a live run, (B) identify the live Command in occupied-checkout diagnostics, coordinating with Say which machine holds a Claim #833, and (C) define behavior when a live run loses its Claim? Recommended: split these concerns so exclusion does not depend on Claim-monitoring policy.
    2. For Ticket A, should direct top-level Ticket runs, Spec runs and applicable Custom processes share the existing origin reservation with Pickup, while dispatched and child work inherit ownership? Recommended: yes, including Continuations and cross-host exclusion, with no automatic stealing of an existing reservation. This would amend ADR-0017's direct-command exemption. Decide whether an explicit operator override is required.
    3. For Ticket B, is local Command identification sufficient initially, or must diagnostics identify owners across hosts? This determines whether local records suffice or reservation/Fleet evidence is required.
    4. For Ticket C, should missing Claims cause a warning, stop the run, be restored automatically, or remain unchanged? Recommended: initially warn while preserving operator labels; reservation-based exclusion should prevent duplicate dispatch independently. Also specify whether a failed Claim check should warn or stop.
  4. added
    ready-for-human
    and removed
    in-progress
    on Nov 10, 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

    enhancementready-for-human

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions