What it means: the resident loop does one thing at a time, and a turn is one of the things. tick awaits forge_driver.run_once(), and Driver::run_once awaits every run it admits — so for as long as a turn is under way, the loop is not detecting. No forge poll, no watch health row, no due task fired, no calendar reminder, no phone delivery.
That is what last_ok_at: 00:35:02 was. The turn started at 00:35:03 and ran to its ten-minute lease; the loop never came round to poll again, so the health row froze 11 minutes back and looked like a network failure. It wasn't one.
Arithmetic: a 60s poll interval and a ten-minute turn is one poll per turn, i.e. a 10× under-poll of every watch during any turn. With the lease raised to an hour (PR #5) the same shape freezes detection for an hour — so this has to land with or before that one.
The change
Daemon::resident_tick — detect, then hand the forge and jobs passes to their own tasks; the interactive drain stays inline, since its runs are the chat itself. run() uses it.
spawn_pass — one pass per lane at a time. A tick that fires mid-pass leaves its events in the dispatcher's inbox, which is already the queue; a second concurrent pass would only lose lease acquisitions to the first and log the loss. The in-flight flag is released by a drop guard, so a panicking pass cannot strand its lane.
Daemon::tick keeps its shape and semantics exactly: --once and the tests still mean "the work happened" when a pass returns, and the [claw] pass: N detected, H handled, F failed line is unchanged there. The detached passes log without a detected count, which they do not own.
The jobs lane is in here too, not just the forge one: same defect, same fix, and a coding job is the longest run the daemon has. Two lines apart, so splitting them would just be two reviews of one idea.
What this does not fix
A tick that fires while a pass runs does no admission of its own, so a key released mid-pass waits for the next tick to pick it up (≤ one poll interval, 60s). That is the debounce the dispatcher already applies to a re-acquire; it is not new latency, and removing it means an admission path separate from the pass, which is a bigger change.
Test
a_spawned_pass_holds_its_lane_instead_of_stacking — a gated stub handler: the pass starts on its own task (the caller has already returned), the lane reads as held while it runs, a second spawn_pass mid-pass is skipped rather than stacking, and the flag clears when the pass ends. Deterministic (semaphores, not sleeps) with a timeout on the start, so a regression fails instead of hanging.
bin/gate.sh is green locally (fmt, clippy -D warnings, check — all targets). No test binaries can run on this box; CI runs them.
**What it means:** the resident loop does one thing at a time, and a turn is one of the things. `tick` awaits `forge_driver.run_once()`, and `Driver::run_once` awaits every run it admits — so for as long as a turn is under way, the loop is not detecting. No forge poll, no watch health row, no due task fired, no calendar reminder, no phone delivery.
That is what `last_ok_at: 00:35:02` was. The turn started at 00:35:03 and ran to its ten-minute lease; the loop never came round to poll again, so the health row froze 11 minutes back and looked like a network failure. It wasn't one.
Arithmetic: a 60s poll interval and a ten-minute turn is one poll per turn, i.e. a 10× under-poll of every watch during any turn. With the lease raised to an hour (PR #5) the same shape freezes detection for an hour — so this has to land with or before that one.
## The change
- `Daemon::resident_tick` — detect, then hand the forge and jobs passes to their own tasks; the interactive drain stays inline, since its runs are the chat itself. `run()` uses it.
- `spawn_pass` — one pass per lane at a time. A tick that fires mid-pass leaves its events in the dispatcher's inbox, which is already the queue; a second concurrent pass would only lose lease acquisitions to the first and log the loss. The in-flight flag is released by a drop guard, so a panicking pass cannot strand its lane.
- `Daemon::tick` keeps its shape and semantics exactly: `--once` and the tests still mean "the work happened" when a pass returns, and the `[claw] pass: N detected, H handled, F failed` line is unchanged there. The detached passes log without a detected count, which they do not own.
The jobs lane is in here too, not just the forge one: same defect, same fix, and a coding job is the longest run the daemon has. Two lines apart, so splitting them would just be two reviews of one idea.
## What this does not fix
A tick that fires while a pass runs does no admission of its own, so a key released mid-pass waits for the next tick to pick it up (≤ one poll interval, 60s). That is the debounce the dispatcher already applies to a re-acquire; it is not new latency, and removing it means an admission path separate from the pass, which is a bigger change.
## Test
`a_spawned_pass_holds_its_lane_instead_of_stacking` — a gated stub handler: the pass starts on its own task (the caller has already returned), the lane reads as held while it runs, a second `spawn_pass` mid-pass is skipped rather than stacking, and the flag clears when the pass ends. Deterministic (semaphores, not sleeps) with a timeout on the start, so a regression fails instead of hanging.
`bin/gate.sh` is green locally (fmt, clippy `-D warnings`, check — all targets). No test binaries can run on this box; CI runs them.
`tick` awaited `forge_driver.run_once()` (and the jobs one before it), and
`Driver::run_once` awaits every run it admits. So while a turn was under
way the loop stopped doing everything else: no forge poll, no watch
health, no due task, no calendar reminder, no phone delivery. With a 60s
poll interval and a ten-minute turn, the daemon polled once per turn —
which is why `last_ok_at` sat frozen at 00:35:02 while the turn that
started at 00:35:03 ran. Not a network problem, and not the watch.
Worse in combination with a longer lease: an hour-long turn would freeze
detection for an hour.
Split the pass. The resident loop (`run`) now uses `resident_tick`, which
detects and then hands the forge and jobs passes to their own tasks; the
interactive drain stays inline, since its runs are the chat itself. One
pass per lane at a time — a tick that fires mid-pass leaves its events in
the dispatcher's inbox for the next one, which is the queue the
dispatcher already is; a second concurrent pass would only lose lease
acquisitions to the first. The in-flight flag is cleared by a drop guard,
so a panicking pass cannot strand its lane permanently.
`tick` keeps its exact shape and semantics: `--once` and the tests still
mean "the work happened" when a pass returns, and the forge-line log
(`[claw] pass: N detected, H handled, F failed`) is unchanged there. The
detached passes log without the detected count, which they do not own.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
What it means: the resident loop does one thing at a time, and a turn is one of the things.
tickawaitsforge_driver.run_once(), andDriver::run_onceawaits every run it admits — so for as long as a turn is under way, the loop is not detecting. No forge poll, no watch health row, no due task fired, no calendar reminder, no phone delivery.That is what
last_ok_at: 00:35:02was. The turn started at 00:35:03 and ran to its ten-minute lease; the loop never came round to poll again, so the health row froze 11 minutes back and looked like a network failure. It wasn't one.Arithmetic: a 60s poll interval and a ten-minute turn is one poll per turn, i.e. a 10× under-poll of every watch during any turn. With the lease raised to an hour (PR #5) the same shape freezes detection for an hour — so this has to land with or before that one.
The change
Daemon::resident_tick— detect, then hand the forge and jobs passes to their own tasks; the interactive drain stays inline, since its runs are the chat itself.run()uses it.spawn_pass— one pass per lane at a time. A tick that fires mid-pass leaves its events in the dispatcher's inbox, which is already the queue; a second concurrent pass would only lose lease acquisitions to the first and log the loss. The in-flight flag is released by a drop guard, so a panicking pass cannot strand its lane.Daemon::tickkeeps its shape and semantics exactly:--onceand the tests still mean "the work happened" when a pass returns, and the[claw] pass: N detected, H handled, F failedline is unchanged there. The detached passes log without a detected count, which they do not own.The jobs lane is in here too, not just the forge one: same defect, same fix, and a coding job is the longest run the daemon has. Two lines apart, so splitting them would just be two reviews of one idea.
What this does not fix
A tick that fires while a pass runs does no admission of its own, so a key released mid-pass waits for the next tick to pick it up (≤ one poll interval, 60s). That is the debounce the dispatcher already applies to a re-acquire; it is not new latency, and removing it means an admission path separate from the pass, which is a bigger change.
Test
a_spawned_pass_holds_its_lane_instead_of_stacking— a gated stub handler: the pass starts on its own task (the caller has already returned), the lane reads as held while it runs, a secondspawn_passmid-pass is skipped rather than stacking, and the flag clears when the pass ends. Deterministic (semaphores, not sleeps) with a timeout on the start, so a regression fails instead of hanging.bin/gate.shis green locally (fmt, clippy-D warnings, check — all targets). No test binaries can run on this box; CI runs them.04ff7290c7toc89c18db0cc89c18db0ctoae198c6f26