Skip to content

source-control:babysit-prs: worker-scope per-PR lease did not prevent a concurrent worker on the same PR (duplicate P1 fixes) #524

Description

@kyle-sexton

Lane

babysit (worker tier)

Triggering example

Dispatched as a worker for PR #377. Sequence observed this session:

  1. Acquired the worker lease for melodic-software/claude-code-plugins#377 via manage_babysit_lease.py acquire --scope worker at 2026-07-19T16:57:26Z. Response: "acquired": true, "reclaimed_stale": false — i.e. the lease manager detected no other active worker on this PR.
  2. Head at cycle start was 72a4411. I validated the two open Codex P1 findings (metadata route segment boundary; multi-target credential-absence exit code), fixed both, committed (9230bc3), and attempted a normal push.
  3. Push was rejected non-fast-forward: the remote head had already advanced to 93b66be — a commit authored 11 minutes into my lease (authored 2026-07-19T13:08 EDT / 17:08Z) titled fix(autonomy): metadata route segment boundaries; per-target credential-absence exit codes. It fixed the exact same two P1 findings via a different-but-valid approach.
  4. That commit's co-author trailer is Claude Fable 5; mine is Claude Sonnet 5 — a genuinely separate concurrent worker session, not a re-entrant same-run invocation.
  5. While I was reconciling, the same actor kept pushing (e07514a at 13:18 EDT, further findings) and resolved both P1 review threads. The PR converged to 0 unresolved threads without any contribution from me.

Net effect: two workers independently produced competing branch-owned fixes for the same findings on the same PR at the same time. My fix was wasted work; a bad duplicate push was avoided only because GitHub rejected the non-fast-forward.

Observed vs expected

  • Observed: a --scope worker lease acquire returned acquired: true, reclaimed_stale: false for a PR that another worker was concurrently editing and pushing to. The per-PR worker lease provided no mutual exclusion.
  • Expected: either (a) the second worker's acquire should have observed the first worker's active lease and returned acquired: false so the second worker STOPs-and-reports (per the skill's step-1 contract), or (b) if the first worker's lease had legitimately expired/released mid-flight (heartbeat gap while it kept working), the lease TTL/heartbeat model needs to cover long-running in-flight work so a still-active worker is not seen as absent.

Category

bug (coordination/lease correctness)

Related

Distinct from #472, which covers queue-lease re-entrancy for overlapping cron fires within the same run ("heartbeat and wait"). This is two separate worker sessions both believing they hold an exclusive worker-scope lease on the same PR. Likely the same underlying overlap root cause (#472's long fan-out cycles), surfacing here as a worker-lease exclusivity failure rather than a queue-lease re-entrancy gap.

Impact

Duplicate Opus/Fable worker work on the largest PR in the queue; competing commits on the same lines/fixtures; near-miss on a redundant/conflicting push. If a force-push were used to reconcile two such workers, one worker's committed work could be destroyed.

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: readyTriaged, unblocked, and fully specified; eligible to pick up.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions