Usage/session-limit block is indistinguishable from a hang in gt dog status — duration-based stuck detection terminates healthy workers
Version: gt HEAD-649b832 (Homebrew gastown HEAD-649b832 1.1.0).
When a worker agent is blocked by a Claude usage/session limit, gt dog status --json reports it as state=working with a frozen LastActive — identical to a genuine hang. Nothing in gt dog, bd, or the activity feed surfaces the usage-limit condition, so any automated stuck-agent detection built on those signals will classify a healthy blocked worker as stuck and terminate it.
Observed
A dog showed state=working on an infrastructure molecule for 25 minutes with LastActive frozen equal to WorkStartedAt and zero feed activity. Every signal a stuck-detection routine is told to check said "stuck": duration 2.5x the threshold, no progress, no activity. The decision matrix for that band is to file a death warrant, which another component then executes.
The actual cause was benign and external — tmux capture-pane on the dog's session showed:
You've hit your session limit - resets 8am (America/Indianapolis)The worker was alive and healthy, simply unable to execute until the quota reset. It resumed normally after the reset once nudged.
Impact
Following duration-based stuck detection literally destroys a healthy worker that is holding real work, for a condition that resolves itself. It recurs every time a usage limit is hit mid-dispatch. The same ambiguity covers a second benign case: a worker that has finished but cannot mark itself done (see #4738 / #4808 / #4587) also sits at state=working with a frozen timestamp.
So state=working + frozen LastActive currently means one of three very different things — hung, quota-blocked, or finished-and-stranded — and only one of them should ever be terminated.
Request
Surface the usage/session-limit condition in gt dog status (and ideally in the equivalent status for other agent roles), so detecting it does not require scraping the agent's tmux pane. A distinct state — blocked with a reset time — would let callers wait and retry instead of terminating.
Pane capture is currently the only reliable signal, which means every stuck-detection path has to shell out to tmux and pattern-match English UI text to avoid killing healthy workers. Note also that nudging a session replaces any staged text in its input box, so the recovery action destroys the evidence the decision was based on.
Nearest existing issue is #1066 (Handle rate limit resets), which is about handling the reset rather than making the blocked state observable.
Source: gastownhall/gastown