Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#4890·gastown

Idle reaper kills a freshly-slung polecat 1s after dispatch: it reads the stale last-activity and state=exiting from the polecat's PREVIOUS session

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

Summary

When a long-idle polecat is reused by gt sling, the daemon's idle reaper evaluates it against the previous session's last-activity timestamp and lingering state=exiting, not the fresh spawn. Any reused polecat that has been idle longer than the threshold is killed within seconds of being dispatched.

The bead is left HOOKED to a polecat with no session — it does not return to the ready pool, so the work silently stops.

Evidence

gt sling ha-f8j habitolotl reused zircon at 00:40:41Z (= 20:40:41 local). From ~/gt/daemon/daemon.log:

2026/09/28 20:40:42 Reaping idle polecat habitolotl/zircon (state=exiting, idle 43h24m45s, threshold 15m0s)
2026/09/28 20:40:46 Reaped idle polecat habitolotl/zircon — session killed, API slot freed

1 second after the sling, the reaper decided a just-spawned session had been idle for 43 hours. zircon's real last activity was its previous session:

2026-09-27 01:16:08 [done] habitolotl/polecats/zircon completed ha-13x.14

Two signals are both stale at the moment of reuse:

  • idle 43h24m45s — measured from the prior session, not from session_start
  • state=exiting — left over from the prior session's teardown

Afterwards ha-f8j was HOOKED to zircon with no live session, and gt unsling ha-f8j habitolotl/zircon could not even clean it up, because resolving the target needs the pane that was just killed:

Error: resolving target agent: getting pane for ha-zircon: exit status 1

Recovery required going around gt: bd update ha-f8j --status open.

This is rare but not a one-off

Every idle reap in this daemon's history has the same shape — state=exiting plus an hours-stale idle time:

2026/08/26 10:33:48 Reaping idle polecat embroidery/nux (state=exiting, idle 8h16m55s, threshold 15m0s)
2026/09/28 20:40:42 Reaping idle polecat habitolotl/zircon (state=exiting, idle 43h24m45s, threshold 15m0s)

Those are the only two reaps on record, which suggests the reaper essentially only ever fires on this path rather than on genuinely idle live sessions.

Expected

  • On reuse/spawn, reset last-activity to session_start before the polecat becomes visible to the reaper, and clear state=exiting.
  • The reaper should refuse to act on a polecat whose session started more recently than the idle threshold, regardless of the persisted timestamp — a session 1s old can never be 15m idle. That single sanity check would have prevented both incidents.
  • A reap that kills a polecat holding hooked work should return the bead to open rather than leaving it HOOKED to a dead agent.
  • gt unsling should not require a live pane to detach work from a dead agent.

Related but distinct

  • #3342 (closed) — "Idle reaper kills working polecat when bead becomes unhooked during failed sling". Same victim, different trigger: there the bead became unhooked; here the bead stays hooked and the reaper's own clock is stale.
  • #4478 — polecat name reuse + stale registry ghosts (adjacent: stale state surviving reuse).
  • #3030 — ReuseIdlePolecat doesn't kill the existing tmux session.

Version

gt version HEAD-649b832

Source: gastownhall/gastown

View original on GitHubView discussion on GitHub