Repository navigation
P5 O5 fix: a forwarded request's end restarts the park clock before the zero count - #443
Merged
Merged
Conversation
…ount, so the count's evaluation reads the clock started at the end and asks no park on the one from its start; a request that outlived idleExitMs (a connectors.call of up to 180 s) no longer has the engine host parked the moment it ends; proved on the real DaemonClocks Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Nov 2, 2026
…he park order, the catch-up restart, O16's render reading); shape B's row 2 closed, the hosted row's signature (23), the discover family tallied Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
SSFSKIM
added a commit
that referenced
this pull request
Nov 2, 2026
…o p5-o17 Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What was wrong
engineRequests().forward(src/mawsd/engine-requests.ts) publishes the in-flight count's drop to zero (clocks.engineRequests(0)) and tells no need at the request's end. When a forwarded request runs longer thanidleExitMs(aconnectors.callof up to 180 s, say), that zero count'sDaemonClocks.evaluate()reads the park clock started at the request's start, finds it overdue, and arms the park the moment the request ends. The engine host parks right after a long request instead of after a fresh idle window, and the next request pays a cold start.The fix
The request's end tells the need first (
clocks.engineNeeded(), which restartsparkSince), then publishes the count. The count's evaluation then reads the clock started at the end and asks nothing. This is the orderp5-o7-m5b(d809057) gave the document hold's release; the hold itself is untouched here and lives on that branch. Both files merge cleanly withp5-o7-m5b(git merge-fileagainst this head): the new test sits after the first case, away from that branch's insertions.Side effect, in line with the need's documented terms: a discovery wake's park still to be asked when a request ends is left to the clock, as for any need.
Red before the fix
src/mawsd/engine-requests.test.ts, "on the real clocks, a request that outlives the idle time asks no park as it ends, and the idle time runs again from there (P5 O5)". It drives the realDaemonClocks(idle 1 s) under fake timers: a forwarded request held 5 s, then answered.Without the source change:
With it, 7/7 pass. The test asserts no park at the end, none at 999 ms after, and
idleat 1000 ms.Gates
All runs are on head 3500cb5, tree c8b999d8b (each run's tree checked equal to the head's).
e2e:discoveralone, with 1 flaky line. Every other job is green.e2e:discover:e2e/discover.spec.ts:584missed the 'legal' search's "13 results" heading within 5 s; the page still showed the grid's placeholders (heading "All", 4 items). This is the tracker row "e2e:discover (catalog-backed assertions)", same case, same signature. Nothing here is on the catalog path, and with an app attached the park clock arms nothing (parkDue()is null).e2e/maws-tools.spec.ts:218(the sidebar hover card didn't show within its 10 stoPassat one window size, on an EC2 overflow Mac) passed on retry in 4.2 s. That is renderer hover timing, out of this diff's reach for the same reason.Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)