Repository navigation
Description
This was generated by AI during triage.
From the 2026-11-11 fleet retrospective: on dev, a retained Review worktree held local branch issue-2067 on Educational-Travel-Adventures/tourbot, causing thirdshift fix base master to crash 47 consecutive times over 9.5 hours at git worktree add ('issue-2067' is already used by worktree at '/tmp/thirdshift-review-Fn838q') and starving every higher-numbered broken pull request in the queue.
Agent Brief
Category: bug
Summary: A scheduled Fix Pass (thirdshift fix base <branch>) selects the lowest-numbered broken pull request from GitHub without checking whether its head branch is already checked out in a local worktree, failing the entire Pass at git worktree add instead of passing over to the next eligible broken pull request.
Current behavior:
GitHub::fix_candidates returns open pull requests needing conflict or CI repair in ascending number order, and the Fix Pass commits to the first candidate GitHub returns. When that pull request's head branch is already checked out locally (for example in the main checkout or a retained Review/Run worktree), worktree creation fails with git's already used by worktree error. Every scheduled Fix Pass repeats the same failure on the same lowest-numbered pull request and never reaches higher-numbered pull requests needing repair.
By contrast, Review Pass candidate selection inspects local git worktree list --porcelain state and passes over branches already held by a local checkout or retained worktree with a clear skip reason.
Desired behavior:
- During
Fix Passcandidate selection (thirdshift fix base <branch>), before committing to a pull request candidate, check local worktree branch occupancy in the repository. - If a candidate pull request's head branch is already checked out in any local worktree (and cannot be safely pruned as a stale registration), log a clear warning/pass-over reason naming the pull request and occupying worktree path, and continue to the next eligible
fix_candidatesentry. - If every broken candidate is passed over because of local branch occupancy, the
Fix Passends cleanly as a skipped Pass (recording the reason in the Activity log / stderr, without recording a failedFix runevery cron tick). - An explicit targeted invocation (
thirdshift fix <PR URL>) continues to fail loudly naming the occupying worktree path, because the operator asked specifically for that pull request.
Key interfaces:
- Local worktree branch inspection (shared with or parallel to Review Pass conflict eligibility): inspect
git worktree list --porcelainfor the candidate'sbranchbeforeFix runacquisition. Fix Passcandidate selection in thefixcommand: iterate throughfix_candidatesuntil an eligible, locally unoccupied pull request is found, or report the passed-over reason(s) on skip.- User manual (
Fix runssection): document that aFix Passpasses over pull requests whose head branch is already checked out in a local worktree, and regenerate the manual HTML (npm run docs --prefix site).
Acceptance criteria:
- When pull request Test #1's head branch is checked out in an existing local worktree and pull request Spec: thirdshift, turn a GitHub issue into a ready-for-review PR unattended #2 also needs a Fix run,
thirdshift fix base <branch>logs why Test #1 was passed over and repairs Spec: thirdshift, turn a GitHub issue into a ready-for-review PR unattended #2. - When the only broken pull request's head branch is checked out in a local worktree,
thirdshift fix base <branch>skips cleanly with a descriptive reason naming the pull request and worktree rather than failinggit worktree add. - Explicit
thirdshift fix <PR URL>on a locally occupied branch still exits non-zero with a clear error naming the occupying worktree. - CLI integration tests cover both passing over to a second candidate and skipping when no other candidate is eligible.
Out of scope:
- Automatically deleting dirty retained worktrees that hold uncommitted tracked edits or unpushed commits (Review run: a pull request that changes mid-run strands its fixes in a retained worktree and is never reviewed again #1961).
Activity
JacobStephens2 commentedon Nov 11, 2026
This comment was generated by AI.
thirdshift's Run on this issue failed, so it waits for the Day shift.
issue-2045on origin, with pull request Fix Pass: pass over pull requests whose head branch is checked out locally (#2045) #2058Put
ready-for-agentback to retry.Fix Pass review: share registration lookup, clarify occupancy wording (…
Merge pull request #2058 from JacobStephens2/issue-2045