Repository navigation
Description
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)
- 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-765in its own worktree while the issue still carriedready-for-agent. - 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 fromsrc/worktree/advice.rs. - Once
issue-765was pushed and the worktree removed,ready-for-agentwent 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. - At 11:50
thirdshift https://github.com/Educational-Travel-Adventures/orchestration/issues/765claimed 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
JacobStephens2 commentedon Nov 10, 2026
Investigation summary
Confirmed against
main(332cdb5): the problem is still present.src/worktree/advice.rs:63(local_branch_advice, the BranchConflict "is not on origin" / "differs from origin" text) and incheckout_adviceat:157(main checkout) and:160(other worktree). These functions take onlylaunch: &Gitand do not know what kind of run called them.branch::select(src/branch.rs:71-74) is the preflight that "fails early ... before the Run makes its Claim" and wraps the error withworktree::local_branch_advice. It is called fromsrc/run.rs:554(fn select). A dispatched (Pickup) Run isStartedBy::Dispatch { base }insrc/run.rs.src/ready.rs:414-421(Reason::Started):started: {evidence}; no ready-for-agent hand-back after the last Claim ended. The rule atsrc/ready.rs:533-537passes over a started issue unlessread.handed_back.src/github.rs:519-573replays label history intoClaimHistory { NeverClaimed, Claimed, Released, HandedBack }(src/github.rs:1500) and already exposesCandidate.claim_generation(the number of Claim applications).claim_generation == 0means thirdshift never claimed the issue.Agent Brief
Goal: when a started
ready-for-agentissue has never been claimed, both the Pickup skip line and the occupied-checkout/local-branch advice for a Pickup run namethirdshift <Issue URL>instead of telling the operator to rerun the original command. Which issues are Ready must not change.Changes:
src/ready.rs: carry "never claimed" intoReason::Started(for example anever_claimed: boolderived fromread.claim_generation == 0, or an enum variant). Render the never-claimed case asstarted: {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 atready.rs:533-537. The testFactsstruct (ready.rs~line 600) needs a field for the Claim count, or for never-claimed, that is fed into theCandidate.src/worktree/advice.rs: let callers say how to retry. For example, givelocal_branch_advice(andcheckout_advicethroughoccupied_advice) a retry argument: the default "rerun the original thirdshift command from the Launch directory on the Base branch", orthirdshift <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:554callingbranch::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.site/index.html,site/how-it-works/andsite/architecture/, plusdocs/guide.md(then regenerate withnpm run docs --prefix site), for the passed-over wording or the rerun advice, and update them if they quote it.Tests:
src/ready.rstests: a started, never-claimed issue gives the new line namingthirdshift <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.src/worktree/advice.rs(src/worktree/acquisition_tests.rs:2197haslocal_branch_advice_commands_preserve_then_recover_work_from_any_directory): the advice for a Pickup run on a never-claimed issue namesthirdshift <Issue URL>and does not say "rerun the original thirdshift command". The default advice is unchanged.scripts/affected-tests main. Targeted:cargo test --bin thirdshift ready::tests,cargo test --bin thirdshift worktree.Done when: a started, never-claimed
ready-for-agentissue logs a passed-over line namingthirdshift <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.
fix: point never-claimed Pickup recovery at Issue URL (JacobStephens2…