Commit d34e11c
fix: start nudge-queue poller for all agents, including Claude (gt-dgf) (#3304)
Queued nudges to idle Claude agents were silently dropping. Root cause:
a circular dependency between the nudge queue and Claude's
UserPromptSubmit hook.
Claude agents drain queued nudges via the UserPromptSubmit hook
(gt mail check --inject). But that hook only fires when the agent
submits a prompt. An idle agent waiting at the prompt never submits,
so the hook never fires, and the nudge never drains. The agent waits
for the nudge; the nudge waits for agent input. Deadlock.
The nudge-queue poller was designed for exactly this case — it polls
every 10s and delivers when the agent is idle. But it was only started
for non-Claude agents, under the assumption that Claude's hook made it
unnecessary. That assumption fails for idle agents.
Fix: start the poller for ALL agents (crew, witness, refinery). The
poller coexists safely with the UserPromptSubmit hook because Drain()
is atomic — whoever drains first wins, the other sees an empty queue.
The poller's idle detection is Claude-aware: checks for "esc to
interrupt" busy indicator, requires prompt prefix visible with 2x
confirmation, and skips drain entirely if the agent appears busy.
Reported by the mayor. Bead: gt-dgf.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Executed-By: gastown/crew/woodhouse
Co-authored-by: gastown/crew/woodhouse <cherub.chopra@gmail.com>1 parent 6a120e0 commit d34e11c
3 files changed
Lines changed: 26 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
878 | 878 | | |
879 | 879 | | |
880 | 880 | | |
881 | | - | |
882 | | - | |
883 | | - | |
884 | | - | |
885 | | - | |
886 | | - | |
887 | | - | |
888 | | - | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
889 | 891 | | |
890 | 892 | | |
891 | 893 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
21 | 22 | | |
22 | 23 | | |
23 | 24 | | |
| |||
239 | 240 | | |
240 | 241 | | |
241 | 242 | | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
242 | 250 | | |
243 | 251 | | |
244 | 252 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
246 | 247 | | |
247 | 248 | | |
248 | 249 | | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
249 | 257 | | |
250 | 258 | | |
251 | 259 | | |
| |||
0 commit comments