Skip to content

Fix Pass repeatedly fails on a locally checked-out pull request branch instead of passing over it #2045

Closed

Description

@JacobStephens2

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 Pass candidate 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_candidates entry.
  • If every broken candidate is passed over because of local branch occupancy, the Fix Pass ends cleanly as a skipped Pass (recording the reason in the Activity log / stderr, without recording a failed Fix run every 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 --porcelain for the candidate's branch before Fix run acquisition.
  • Fix Pass candidate selection in the fix command: iterate through fix_candidates until an eligible, locally unoccupied pull request is found, or report the passed-over reason(s) on skip.
  • User manual (Fix runs section): document that a Fix Pass passes 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:

Out of scope:

Activity

  1. added
    bug
    ready-for-agent
    on Nov 11, 2026
  2. added
    in-progress
    agent-failed
    and removed
    ready-for-agent
    in-progress
    on Nov 11, 2026
  3. JacobStephens2 commented on Nov 11, 2026

    @JacobStephens2
    OwnerAuthor

    This comment was generated by AI.

    thirdshift's Run on this issue failed, so it waits for the Day shift.

    Put ready-for-agent back to retry.

  4. added
    ready-for-agent
    in-progress
    and removed
    agent-failed
    ready-for-agent
    on Nov 12, 2026
  5. removed
    in-progress
    on Nov 12, 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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions