A forge turn is being killed at ten minutes, every time, silently.
What happens
Observed on vhaudiquet/orcaslicer-snap#10 (the v2.5.1 build failure):
lease 1 granted 00:22:54, lease 2 granted 00:35:03 — each turn died exactly 600s after its grant, and the key came back up with last_outcome: null, revision bumped, inbox empty.
No failure anywhere: not in the log, not on the thread. From the dispatcher's point of view the key simply went idle.
The investigation itself was fine — it had cloned the repo, diffed OrcaSlicer 2.5.0 against 2.5.1, found that upstream replaced its vendored expat with find_package(EXPAT 2.10.0 REQUIRED) and written a fix — it just never got to finish it.
Why
Daemon::build's forge dispatcher was assembled on DispatcherConfig::default(). That default is rhema-rsd's, not ours: lease_ttl_millis: 600_000, documented as "the spec's example values" — sized for a single agent step, not a turn that clones a repo and builds a slicer.
Nothing renews the lease once the turn is under way:
SessionContext::poll_inbox renews, and the handler calls it once, at the start of the run (drain_news);
the commit hook that runs before every tool call checkpoints — which fails on a lapsed lease rather than extending a live one.
So the TTL is a hard ceiling on the whole turn, and crossing it is invisible by construction: the turn dies on its next tool call, and then Driver::drive's own checkpoint (and release) return Expired, which leaves no last_outcome behind. The interactive and jobs lanes never had this problem — they hardcode 3_600_000.
The change
forge_dispatch(): the library defaults with lease_ttl_millis: 3_600_000, the same hour the other two lanes lease for. Used by the resident loop and by --once (which took the same default, only with the debounce zeroed). A test pins the TTL and asserts the rest of the knobs still come from the library, so a future default change still reaches us.
Deliberately not in this PR
An hour is a longer ceiling, not no ceiling — a turn that runs longer still dies this way, and the lapse still records no outcome. A real heartbeat needs rhema-rsd to expose a renew without draining the inbox (poll_inbox is renew-and-drain, so calling it mid-turn would steal the run's own events). Worth an upstream issue; not a blocker here.
There is also a second, unrelated stall: Daemon::tick awaits forge_driver.run_once(), so a long turn starves detection — forge polls, task ticks, calendar reminders and phone delivery all wait behind it. Raising the TTL makes that window longer, so it should be fixed next; it is a separate change and a separate PR.
Tests
bin/gate.sh is green locally (fmt, clippy -D warnings, check — all targets). This box cannot execute test binaries, so the new unit test first runs in CI.
A forge turn is being killed at ten minutes, every time, silently.
## What happens
Observed on `vhaudiquet/orcaslicer-snap#10` (the v2.5.1 build failure):
- lease 1 granted 00:22:54, lease 2 granted 00:35:03 — each turn died exactly 600s after its grant, and the key came back up with `last_outcome: null`, `revision` bumped, `inbox` empty.
- No failure anywhere: not in the log, not on the thread. From the dispatcher's point of view the key simply went idle.
The investigation itself was fine — it had cloned the repo, diffed OrcaSlicer 2.5.0 against 2.5.1, found that upstream replaced its vendored expat with `find_package(EXPAT 2.10.0 REQUIRED)` and written a fix — it just never got to finish it.
## Why
`Daemon::build`'s forge dispatcher was assembled on `DispatcherConfig::default()`. That default is **`rhema-rsd`'s**, not ours: `lease_ttl_millis: 600_000`, documented as "the spec's example values" — sized for a single agent step, not a turn that clones a repo and builds a slicer.
Nothing renews the lease once the turn is under way:
- `SessionContext::poll_inbox` renews, and the handler calls it **once**, at the start of the run (`drain_news`);
- the commit hook that runs before every tool call *checkpoints* — which fails on a lapsed lease rather than extending a live one.
So the TTL is a hard ceiling on the whole turn, and crossing it is invisible by construction: the turn dies on its next tool call, and then `Driver::drive`'s own `checkpoint` (and `release`) return `Expired`, which leaves no `last_outcome` behind. The interactive and jobs lanes never had this problem — they hardcode `3_600_000`.
## The change
`forge_dispatch()`: the library defaults with `lease_ttl_millis: 3_600_000`, the same hour the other two lanes lease for. Used by the resident loop and by `--once` (which took the same default, only with the debounce zeroed). A test pins the TTL and asserts the rest of the knobs still come from the library, so a future default change still reaches us.
## Deliberately not in this PR
An hour is a longer ceiling, not no ceiling — a turn that runs longer still dies this way, and the lapse still records no outcome. A real heartbeat needs `rhema-rsd` to expose a renew without draining the inbox (`poll_inbox` is renew-and-drain, so calling it mid-turn would steal the run's own events). Worth an upstream issue; not a blocker here.
There is also a second, unrelated stall: `Daemon::tick` awaits `forge_driver.run_once()`, so a long turn starves detection — forge polls, task ticks, calendar reminders and phone delivery all wait behind it. Raising the TTL makes that window *longer*, so it should be fixed next; it is a separate change and a separate PR.
## Tests
`bin/gate.sh` is green locally (fmt, clippy `-D warnings`, check — all targets). This box cannot execute test binaries, so the new unit test first runs in CI.
The forge dispatcher was assembled on `DispatcherConfig::default()`,
whose ten-minute lease TTL is the spec's example value, sized for a
single agent step. A forge turn is not a step: it clones the repo, reads
it, and may build and test a fix. Nothing renews the lease once the turn
is under way — `poll_inbox` renews but is called once, at the start, and
the commit hook between tool calls checkpoints, which fails on a lapsed
lease rather than extending it — so the TTL is a hard ceiling on a whole
turn.
Crossing it is silent: the turn dies on its next tool call, the driver's
own checkpoint and release then report `Expired`, and the key ends with
no outcome recorded, indistinguishable from a pass that found nothing.
Give the forge lane its own timing — the library defaults with an
hour-long TTL, the same choice the interactive and jobs lanes already
make — and use it in both shapes (`--once` included).
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.
A forge turn is being killed at ten minutes, every time, silently.
What happens
Observed on
vhaudiquet/orcaslicer-snap#10(the v2.5.1 build failure):last_outcome: null,revisionbumped,inboxempty.The investigation itself was fine — it had cloned the repo, diffed OrcaSlicer 2.5.0 against 2.5.1, found that upstream replaced its vendored expat with
find_package(EXPAT 2.10.0 REQUIRED)and written a fix — it just never got to finish it.Why
Daemon::build's forge dispatcher was assembled onDispatcherConfig::default(). That default isrhema-rsd's, not ours:lease_ttl_millis: 600_000, documented as "the spec's example values" — sized for a single agent step, not a turn that clones a repo and builds a slicer.Nothing renews the lease once the turn is under way:
SessionContext::poll_inboxrenews, and the handler calls it once, at the start of the run (drain_news);So the TTL is a hard ceiling on the whole turn, and crossing it is invisible by construction: the turn dies on its next tool call, and then
Driver::drive's owncheckpoint(andrelease) returnExpired, which leaves nolast_outcomebehind. The interactive and jobs lanes never had this problem — they hardcode3_600_000.The change
forge_dispatch(): the library defaults withlease_ttl_millis: 3_600_000, the same hour the other two lanes lease for. Used by the resident loop and by--once(which took the same default, only with the debounce zeroed). A test pins the TTL and asserts the rest of the knobs still come from the library, so a future default change still reaches us.Deliberately not in this PR
An hour is a longer ceiling, not no ceiling — a turn that runs longer still dies this way, and the lapse still records no outcome. A real heartbeat needs
rhema-rsdto expose a renew without draining the inbox (poll_inboxis renew-and-drain, so calling it mid-turn would steal the run's own events). Worth an upstream issue; not a blocker here.There is also a second, unrelated stall:
Daemon::tickawaitsforge_driver.run_once(), so a long turn starves detection — forge polls, task ticks, calendar reminders and phone delivery all wait behind it. Raising the TTL makes that window longer, so it should be fixed next; it is a separate change and a separate PR.Tests
bin/gate.shis green locally (fmt, clippy-D warnings, check — all targets). This box cannot execute test binaries, so the new unit test first runs in CI.c859df292dto78fdec4f49