Repository navigation
index source: a failed fs.scan is retried, and fs.scan gets a 120 s budget - #452
Merged
Merged
Conversation
…s, within its generation, never past an answered scan or the stop), and fs.scan gets a 120 s budget on every supervisor the index source scans through (mawsd's, main's embedded); the owner's 7,750-session store outran the 10 s default and left discovery unknown until the next host transition Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
SSFSKIM
added a commit
that referenced
this pull request
Nov 3, 2026
SSFSKIM
added a commit
that referenced
this pull request
Nov 3, 2026
…3.23 regenerated from master's 3.22 manifest (master's 3.22 is O7 M5c's), O17's capabilities beside machine.delivery; the engine host's spawn keeps O17's spawner env beside #452's requestBudgetsMs; the endpoint services carry O17's browser beside O7 M5c's clientPort; the latency stub's header keeps both notes 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.
The defect
On the owner's MacBook after the update to master 7594474, mawsd logged
[index] fs.scan failed: engine-host did not answer fs.scan within 10 s. 3.6 s later it loggeddropped engine-host's response to unknown request 36. The scan finished in about 13.6 s on a store of about 7,750 indexed sessions, but the supervisor's default deadline (REQUEST_TIMEOUT_MS, 10 s) had already failed the request and dropped the answer.IndexSessionSource.sync()only runs at the engine host's streaming, so a null scan leftscannedfalse until the next host transition. Until then:discoveryCurrent()anddiscoveryApplied()stayed false, which held the inactivity archive and mawsd's discovery wake;The design and why
There are two parts. The budget stops a slow scan on a large store from failing in the first place. The retry stops any failed scan from leaving discovery stuck. Either part alone leaves one of those cases open.
Budget.
ENGINE_HOST_BUDGETS_MS = { 'fs.scan': 120_000 }(src/shared/host/host-supervisor.ts) is set asrequestBudgetsMson every engine-host spec whose supervisor the index source scans through:src/mawsd/daemon.ts), the shape the defect was seen on;src/main/hosts/index.ts), where the spine runs in main.Main's daemon-shape specs (
daemonHostSpecs) are unchanged: on that shape main never sendsfs.scan, anddaemon.test.tspins that the engine host gets no budget there.Why 120 s: the scan's time grows with the store. It lists every transcript, reads each one the index does not hold, and waits behind any scan the host is still running. Earlier measurements were 1.4–3 s for 3,100–5,100 transcripts; this one was 13.6 s for 7,750 just after an update. 120 s is about 9 times the worst seen. A long budget does not delay recovery from a lost host, because a request already sent fails with
host_unavailablewhen the link drops (failSent). It also leaves the handover's wait for sent requests (HANDOVER_SENT_WAIT_MS) unchanged.fs.bindgets no budget. Its cost does not grow with the store: it only changes the in-memory binding table and re-follows the followed sessions whose engine id moved. It reads no transcripts.Bounded retry. When a sync's scan answers null, the sync runs again after
SCAN_RETRY_MS(2 s, 10 s, 30 s), so a generation gets at most four attempts. After that, mawsd logsfs.scan failed N times; discovery waits for the engine host's next start. A waiting retry is dropped:scanned).One retry waits at most, and
this.syncsalready runs one sync at a time.How the retry interacts with the rest of the source:
fs.sessionChangedevents still arrive and are applied. The retry's scan queues in the host behind the one still running, becauseFsServiceruns one scan at a time. It reads only what the index does not hold by then, so each retry has less to read. The invariant that a scan's discoveries arrive before its answer still holds for the retry's answer.sessionSearch.retryFailures()now runs once per host start (attempt === 0), not on every retry, so a retry does not give text reads that failed since then a second round of three attempts. Stamps the retry's scan reports again are deduplicated by stamp insearchQueue, as before.fs.state's holder fold. Each retry folds again from the registry as the host reports it at that moment. The fold is idempotent.generation. The retry is tied to the generation its first sync ran in, and is checked both when it is scheduled and when it fires.Tests
In
src/services/index/source.test.ts, with the retry schedule injected throughSourceOptions.scanRetryMs(the same waytickMsandsearchDebounceMsare injected):The budget has no new test. It is a constant on two specs, and the
requestBudgetsMsmechanism is already tested inhost-supervisor.test.ts("a request's deadline"). A test of the wiring would only restate the edit.Locally I ran only the focused file (52/52) and eslint, one changed file at a time.
Gates
Static (
--gates static --class1a pool --runner macos --peer none): run 41549538392, success, 0 flaky lines.Landing (
--gates all --class1a pool --runner macos --lane hosted): run 41550088326, success on attempt 1. No hold was in force at launch, but the hosted lane kept the run out of CI-opt's 01:05Z mini hold. All jobs were green, with 2 flaky lines, both in specs this change does not reach:e2e/connectors.spec.ts:304(daemon restart, lease rebuilt): the MCP server's call count readn=1after the restart. That is the connector lease's server reuse, not the index source.e2e/supervisor.spec.ts:1047(G4, terminals outlive the app on the daemon shape): the quit guard's line said1 mid-turn, not askedwithout the busy terminals, because the quit raced the shells' busy report.The run logged no
fs.scan failedline anywhere, so the retry path never ran in it.Review
doperpowers:reviewer-mediumreviewed75944744d..cc607f69aand found no material issues, so there was no fix round.Residue
None.
Sminos-Session: GUI AI agent workspace charter#37052769 (MAWS on macbook)