Skip to content

source-control:babysit-prs: worker lease doesn't prevent a concurrent lane duplicating work, and a non-force push after merge resurrects the auto-deleted branch #645

Description

@kyle-sexton

Lane: babysit, observed on #634, session 2026-07-20.

What happened: a babysit worker held #634's worker lease and was independently fixing the same chatgpt-codex-connector finding ("truncated review-thread pages") that a separate concurrent kyle-sexton lane was also fixing at the same time. The other lane finished first, replied, resolved the thread, and squash-merged the PR (mergeCommit 3f428074, head bb55a5db, merged 07:57:45Z) — which triggers GitHub's auto-delete-branch-on-merge. Moments later the babysit worker, unaware the PR had just merged, pushed its own equivalent (but not identical) fix commit b914d56 to the same branch name. A non-force push to a branch name that doesn't exist on the remote creates it fresh — so this resurrected fix/534-babysit-shared-classifier as a zombie branch on a MERGED, closed PR, containing a commit that never reached main.

Two distinct gaps:

  1. Lease contention is per-PR-in-this-lane only. It does nothing to prevent a different concurrent lane (this session observed at least 4: "work lane", "work-2 lane", "control tower", this babysit lane) from doing the same work at the same time. No cross-lane coordination mechanism exists.
  2. No merged/closed re-check immediately before push. The worker checked out, fixed, and pushed without re-verifying the PR was still OPEN right before the push — a real TOCTOU gap given how fast concurrent lanes are landing merges this session (15 merges in ~5 hours).

Expected: before any worker pushes a commit, re-fetch the PR's state (note: gh pr view --json merged is an invalid field — use state/mergedAt) immediately beforehand and abort the push if it's no longer OPEN, reporting the race instead of resurrecting a dead branch. Cross-lane lease coordination is a bigger ask (would need a shared lock surface across all lanes, not just this skill's own lease file) — flagging as a known limitation rather than proposing a fix here.

Cleanup needed: the resurrected branch fix/534-babysit-shared-classifier @ b914d56e still exists on melodic-software/claude-code-plugins as of this filing — its content never merged (the branch protection cross-tier invariant against deleting unmerged branches means this lane won't delete it itself; left for a human to clean up).

Category: bug (race condition / TOCTOU gap).

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-humanHuman-in-the-loop required; autonomous sessions must not resolve items carrying this.priority: mediumReal value, no hard deadline; normal backlog flow.status: needs-decisionAwaiting a human or maintainer judgment call.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions