Skip to content

Point a never-claimed started issue at the Issue URL command, not a Pickup rerun #1448

Closed

Description

@JacobStephens2

This was generated by AI during triage.

Problem

A Pickup run that collides with an occupied checkout tells the operator to push the branch and "rerun the original thirdshift command ... to use the normal Continuation path for the published Issue branch". When the original command is a Pickup run and thirdshift never claimed the issue, that rerun can never continue: the Ready-issue rule from #617 passes over a started issue that was never claimed. The operator follows the advice, and the issue is then skipped every minute with nothing pointing to the command that would work.

What happened (Educational-Travel-Adventures/orchestration#765, thirdshift 0.16.5, 2026-10-27)

  1. An interactive Claude session's subagent started make release.sh watch ci on default if running and start a release when it is done #765 on a local issue-765 in its own worktree while the issue still carried ready-for-agent.
  2. The every-minute Pickup run failed 12 times between 10:41 and 10:52 with the local branch issue-765 is not on origin. Each Needs-you notice gave the push-then-rerun alternative from src/worktree/advice.rs.
  3. Once issue-765 was pushed and the worktree removed, ready-for-agent went back on (15:14:45Z). Every Pickup pass after that logged #765 started: issue-765 is on origin; no ready-for-agent hand-back after the last Claim ended, because the label history held no Claim to release.
  4. At 11:50 thirdshift https://github.com/Educational-Travel-Adventures/orchestration/issues/765 claimed it and continued from the pushed branch without trouble.

The rule is right: #617 deliberately keeps Pickup off a branch someone is working outside the factory. The advice and the passed-over line are what fail the operator.

What to change

  • When the command was a Pickup run and the issue has no Claim history, the occupied-checkout advice names the Issue URL command, thirdshift <Issue URL>, rather than "rerun the original thirdshift command".
  • The passed-over line for a started issue that was never claimed says so and names the same command, e.g. #765 started: issue-765 is on origin and thirdshift never claimed it; run thirdshift <Issue URL> to continue it. Keep the current wording for an issue whose Claim was released and not handed back.
  • No change to which issues are Ready.

Done when

A started, never-claimed ready-for-agent issue logs a passed-over line that names thirdshift <Issue URL>, and the occupied-checkout advice for a Pickup run on such an issue does the same. Tests in src/ready.rs and alongside src/worktree/advice.rs cover both lines.

Activity

  1. added
    enhancement
    needs-triage
    on Oct 27, 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 against main (332cdb5): the problem is still present.

    • The advice "rerun the original thirdshift command" is still in src/worktree/advice.rs:63 (local_branch_advice, the BranchConflict "is not on origin" / "differs from origin" text) and in checkout_advice at :157 (main checkout) and :160 (other worktree). These functions take only launch: &Git and do not know what kind of run called them.
    • A Pickup run that hits this fails before any Claim. branch::select (src/branch.rs:71-74) is the preflight that "fails early ... before the Run makes its Claim" and wraps the error with worktree::local_branch_advice. It is called from src/run.rs:554 (fn select). A dispatched (Pickup) Run is StartedBy::Dispatch { base } in src/run.rs.
    • The skip line is fixed text in src/ready.rs:414-421 (Reason::Started): started: {evidence}; no ready-for-agent hand-back after the last Claim ended. The rule at src/ready.rs:533-537 passes over a started issue unless read.handed_back.
    • No new GitHub read is needed. src/github.rs:519-573 replays label history into ClaimHistory { NeverClaimed, Claimed, Released, HandedBack } (src/github.rs:1500) and already exposes Candidate.claim_generation (the number of Claim applications). claim_generation == 0 means thirdshift never claimed the issue.

    Agent Brief

    Goal: when a started ready-for-agent issue has never been claimed, both the Pickup skip line and the occupied-checkout/local-branch advice for a Pickup run name thirdshift <Issue URL> instead of telling the operator to rerun the original command. Which issues are Ready must not change.

    Changes:

    1. src/ready.rs: carry "never claimed" into Reason::Started (for example a never_claimed: bool derived from read.claim_generation == 0, or an enum variant). Render the never-claimed case as started: {evidence} and thirdshift never claimed it; run thirdshift {issue URL} to continue it, e.g. #765 started: issue-765 is on origin and thirdshift never claimed it; run thirdshift https://github.com/o/r/issues/765 to continue it. Keep the current wording when a Claim was released and not handed back. Do not change the selection rule at ready.rs:533-537. The test Facts struct (ready.rs ~line 600) needs a field for the Claim count, or for never-claimed, that is fed into the Candidate.
    2. src/worktree/advice.rs: let callers say how to retry. For example, give local_branch_advice (and checkout_advice through occupied_advice) a retry argument: the default "rerun the original thirdshift command from the Launch directory on the Base branch", or thirdshift <Issue URL> for a Pickup run on a never-claimed issue. For the pre-Claim preflight, a Pickup-dispatched Run (StartedBy::Dispatch, src/run.rs:554 calling branch::select, src/branch.rs:71-74) has not made its Claim yet. In practice this case is always never-claimed when the issue has no Claim history, so pass the Issue URL command there. Check whether Spec runs dispatched by Pickup (src/spec_run.rs) reach the same preflight, and treat them the same way. The checkout-taking step after the Claim (src/worktree/acquisition.rs, src/worktree.rs:162/178) is out of scope: there a Claim exists, so keep the existing wording.
    3. Search site/index.html, site/how-it-works/ and site/architecture/, plus docs/guide.md (then regenerate with npm run docs --prefix site), for the passed-over wording or the rerun advice, and update them if they quote it.

    Tests:

    • src/ready.rs tests: a started, never-claimed issue gives the new line naming thirdshift <Issue URL>. A started issue whose Claim was released and not handed back keeps the existing line (the tests near lines 992, 1129, 1379, 1432 and 1478 use it today). The Ready/not-Ready result is unchanged.
    • Next to src/worktree/advice.rs (src/worktree/acquisition_tests.rs:2197 has local_branch_advice_commands_preserve_then_recover_work_from_any_directory): the advice for a Pickup run on a never-claimed issue names thirdshift <Issue URL> and does not say "rerun the original thirdshift command". The default advice is unchanged.
    • Final check: scripts/affected-tests main. Targeted: cargo test --bin thirdshift ready::tests, cargo test --bin thirdshift worktree.

    Done when: a started, never-claimed ready-for-agent issue logs a passed-over line naming thirdshift <Issue URL>, and the preflight advice for a Pickup run on such an issue does the same, with tests for both.

    ready-for-agent was recommended; ready-for-human is applied until the Day shift permits readiness.

  4. added
    ready-for-human
    and removed
    in-progress
    on Nov 10, 2026
  5. added
    ready-for-agent
    in-progress
    and removed
    ready-for-human
    ready-for-agent
    on Nov 18, 2026
  6. removed
    in-progress
    on Nov 18, 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

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions