fix: prevent stale paused-task wakes from triggering false stalls - #3878
fix: prevent stale paused-task wakes from triggering false stalls#3878wjkawecki-jt wants to merge 5 commits into
Conversation
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Reviews (4): Last reviewed commit: "test(watch): age pause recheck fixture" | Re-trigger Greptile |
…sh by moving crew_absorb_class below the fresh pause-recheck short-circuit, preventing unnecessary fm-crew-state subprocesses during the bounded interval. bash -n and the focused fm-watch-triage suite passed through the relevant pause-recheck tests; git diff --check is clean
…down earlier multi-home fixtures before concurrent recovery and removing duplicate later cleanup entries. `bash -n` and `git diff --check` pass
|
We fixed the same class of bug in a fork of firstmate recently, in the same function, so I read this diff closely rather than skimming it. First, what this gets right, because it took us a while to get here too: endpoint liveness is not evidence that a declared wait ended. The two notes below are both about the same thing: the bound holds across a churning pane hash, but the status log is a separate source of churn, and it is the one that bit us. 1. Any later line from any producer retracts the declaration.
The sequence: a worker declares What we measured on our side before we fixed it, over four days in one lane: stale (possible wedge) wakes were 320 wakes / 1,598 model requests / 37.8% of supervisor cost. 2. The re-surface throttle is skipped, rather than applied, when the log grows.
I ran your Five appends, five wakes, each at age 0 against a throttle 0 seconds old. 3. The one that does NOT apply here - but might apply to the fix. Our worst bug was that the re-surface age was anchored on the status file's mtime, which every append resets, so a worker whose own reporter appended every few minutes suppressed supervision indefinitely with no recheck. The reason I am mentioning it at all is what we measured when we removed the masking. Zero wakes across five appends. On the test: For what it is worth, findings 1 and 2 were introduced by our own instructions to the worker who wrote our fix, and caught by review afterwards. |
Intent
A paused task's declared wait was not treated as authoritative for bounded stale rechecks, so a task legitimately waiting could be reported as a false stall.
What Changed
paused:declarations as authoritative for bounded stale-wake rechecks regardless of endpoint-liveness reads.captain-heldtransfers, while allowing authoritative working state to restore normal wedge tracking when a pause recheck lapses.Risk Assessment
✅ Low: The change is bounded to paused-wait stale triage, updates its documentation, and adds behavioral regression coverage; the reviewed paths preserve rechecks, release handling, and wedge escalation without a source-verifiable defect.
Testing
Ran the focused watcher triage test file; the new stale-wake regression scenarios passed, including end-to-end durable queue and watcher behavior. No reviewer-visible artifact was produced because this is CLI behavior rather than a rendered UI.
Pipeline
Updates from git push no-mistakes
✅ **intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ **Review** - passed
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
tests/fm-watch-triage.test.shLive declared-wait cadence, pane-hash churn, re-surfacing, pause release, captain-held fallback, and authoritative working-state reconciliation✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.