#4889·gastown

check-recovery returns PENDING_MR forever when active_mr points at a GC'd wisp, making every polecat unreusable until the rig hits its directory cap

Author: SaulGarzaCreated Sep 29, 2026Updated Sep 30, 2026
Labelsstatus/needs-triage

Summary

If a polecat's active_mr references an MR wisp that no longer exists, gt polecat check-recovery returns PENDING_MR ("Work is waiting on an active merge request; preserve this polecat until it lands") even though the work has already landed on master. The polecat is never reusable (reuse: idle-recovery-needed), directories accumulate, and the rig eventually refuses to spawn:

Error: spawning polecat: rig habitolotl has 30 polecat directories (max 30).
Resolve recovery-needed polecats before allocating more slots

At that point gt sling cannot dispatch anything to the rig. This is how it presents to an operator: total dispatch outage with no obvious cause.

Evidence

Four polecats in rig habitolotl, all verdict PENDING_MR, all with an active_mr that does not resolve:

polecat issue active_mr wisp resolves? issue on master?
agate ha-uz8 ha-wisp-qn1x no yes (775566b)
amber ha-ab9.9 ha-wisp-w83y no yes
onyx ha-at3.5 ha-wisp-ti68 no yes
opal ha-70d.1 ha-wisp-noju no yes
$ gt polecat check-recovery habitolotl/agate
  Cleanup Status:  clean
  Branch:          polecat/agate/ha-uz8+mulqehrv
  Issue:           ha-uz8
  Active MR:       ha-wisp-qn1x
  Verdict:         PENDING_MR
  Work is waiting on an active merge request; preserve this polecat until it lands.

$ bd show ha-wisp-qn1x
Error fetching ha-wisp-qn1x: no issue found matching "ha-wisp-qn1x"

$ git log --oneline origin/master --grep=ha-uz8
775566b fix: e2e survives concurrent runs ... (ha-uz8)

The merge queue is empty (gt refinery queue → (empty)), so nothing is actually pending.

Control (the lookup is not simply broken): a wisp that does exist resolves fine on the same command —

$ bd show ha-wisp-pita
○ ha-wisp-pita · mol-polecat-work   [● P2 · OPEN]
Type: molecule

How the wisps went away

We hit a wisp-ledger blowup (16k+ wisps) and ran the documented GC:

bd mol wisp gc --closed --force --exclude-type molecule

MR wisps are step wisps, not molecules, so they were deleted (~15,000). The molecule roots were correctly preserved — that's what --exclude-type molecule is for. Nothing warned that polecat active_mr pointers referenced those step wisps, and nothing reconciled them afterwards.

So this is reachable from normal documented maintenance, not just from corruption.

Expected

An unresolvable active_mr should not be treated as "still pending". Suggested precedence:

  1. If active_mr does not resolve → it cannot be pending. Fall through to the other predicates instead of returning PENDING_MR.
  2. If the polecat's issue is present on the base branch → report landed / SAFE_TO_NUKE.
  3. Only report PENDING_MR when the MR bead actually resolves and is non-terminal.

A --reconcile-cleanup-style repair that clears dangling active_mr pointers would also fix the stuck state without forcing operators to nuke. Right now the only way out is gt polecat nuke, which is a strange remedy for "the work already merged".

Workaround

Verify the issue is on master independently, then nuke:

gt polecat nuke <rig>/<name>

Related but distinct

  • #4513 (closed) — NEEDS_RECOVERY with no named blocker for completed+merged polecats. Different verdict, and that one had no active MR at all.
  • #4478 — polecat name reuse + stale registry ghosts.
  • #4631 — the verdict switch renders WORKING as SAFE_TO_NUKE.

Version

gt version HEAD-649b832