Repository navigation
Session History: the "Reading N / M files" count reaches its total - #30683
Conversation
The scan's first pass announced its whole candidate slice (limit x 2) as files to read, then stopped once it had enough sessions, and nothing took the unread files back out of the total. The parse loop now owns its share of the total: an unfiltered pass announces its list and takes back what it never read; a filtered walk keeps announcing per selected batch.
|
Session History announced files before reading them, then stopped early when it had enough recent sessions. The unread remainder stayed in the total during the later Workspace walk, leaving “Reading N / M files” below a total the scan could no longer reach. The parser now owns both announcing planned reads and retiring the suffix it skips. The total can decrease when a pass stops early. Session selection, order, the depth limit, per-agent counts and the “Scanned N files” finish are unchanged. Full-path review completed on Real Electron QA compared main
Deferred, accepted existing behavior: the last active Reading frame is not guaranteed to balance before Scanned replaces it. Head Workspace ended its active frames at 358/385 and global All at 48/500; Scanned replaced those frames about 731ms and 696ms later. Warm scans painted no Reading frame. No publication flush was added. On the long Workspace walk, 297/297 appeared after the 203-file suffix was removed and before real scope reads were announced. A later 5.961-second event gap occurred while actual scope reads remained pending, after the unreachable debt had been retired. Its cause was not established. The nominal 1000ms cadence is not a universal wall-clock bound. Run times varied and these captures are not a controlled performance comparison. Live Windows, WSL, Linux, SSH and mixed-version flows, cancellation/failure, CPU and heap measurements were not exercised; relevant paths were source-reviewed. Both builds logged existing listener warnings without new visible errors. Full-window screenshots and raw session metadata remain private; the progress crops below contain no transcript content. For Brennan’s review: Workspace, main → head during the later walk (the head subsequently continued real scope reads): Global All, main → head last active frame → unchanged finish. The head’s active frame still lags; its finished event is 297/297: Project, main → head (neither warm scan painted Reading): Two intended judgments: the parse loop owns the initial total, and it retires the suffix it skips. The existing N/M display is retained intentionally. Remote QA apps, servers, transfer shell, copied corpus/rigs/evidence and QA checkout were cleaned up after the full evidence was checksum-verified on the coordinator. |
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 11 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |







ELI5
While Session History scans your agents' transcripts, a strip says "Reading N / M files". The count could never reach its total: a teammate's strip sat at "Reading 2,417 / 3,259 files" until the scan finished. The scan promised to read files it then never needed, and never took them back off the total. Now it does, so the count no longer sits below a total it can never reach.
What Changed
Before: on a large history, the first part of the scan put its whole list of candidate files on the total, up to twice the History depth (2,000 at the default). It then stopped as soon as it had enough sessions, typically well short of that list. The unread files stayed on the total for the rest of the scan. The teammate's numbers fit this (the split between passes is inferred, not measured): 1,158 of 2,000 planned files read, plus 1,259 read by the Workspace walk, gives 2,417 / 3,259.
After: when that first pass stops early, the files it skipped come off the total, so the strip no longer stalls below a total the scan can't reach, and the scan's final report has the count equal to its total. The strip still switches to "Scanned N files" when the scan finishes, as before. The existing progress throttle can leave the last "Reading" frame short before "Scanned" replaces it. That behavior is accepted and unchanged. Its nominal one-second update interval is a scheduler cadence, not a wall-clock guarantee during a stalled event loop or filesystem operation.
Mechanism. The scan has three passes that read transcripts: the newest-first pass, the Workspace or Project folder walk, and the per-folder Claude pass. Each pass told the progress tally how many files it would read, but only
parseSessionCandidatesknows how many it actually reads. Now that loop owns its share of the total:noteAiVaultScanUnread, a newdropUnreadon the tally).Plan (full review path). Keep the existing total and session limit, and put announcement and retirement of planned reads in the parse loop that knows which files it skips. This changes five production files (+26/-6), adds one regression, and changes no saved data, payload shape, scan selection, ordering, or process/session lifecycle. The review rejected the light path because the mutable count is reported from the scan worker to windows. Correctness, architecture, a dedicated performance pass, independent plan checks, real Electron QA, and the full PR workflow passed on the final head. No publication or throttling changes are planned.
Why
The common pattern uses a spinner or "Scanning…" for discovery that can stop early. Orca keeps its existing "N / M" display; the loop that decides which reads are needed also owns the total it announces.
Options considered:
Difference from the common pattern, labelled:
Linked Issue
Follow-up to #30469 (tracked in STA-11097), whose plan listed this as a separate fix in the scan tally.
Visual Proof
Compared main
83c768d1b433with head006b712232b1e170dd327bf3fc5c30f18baf311fon the qa-gate-admitted M4Air, using the same 4,479 genuine transcript files. All seven paired flows preserved ordered session rows, metadata, per-agent counts, the depth limit, and the final Scanned footprint. Exact results and before/after progress screenshots. The approved exception was used: the existing signed-in Codex worker drove the isolated app directly through CDP.The long Workspace walk painted 297/297 after retiring the unread suffix. The last Reading frames were 358/385 for Workspace and 48/500 for global All; Scanned replaced them about 731ms and 696ms later. These are measured examples, not a hard timing guarantee. Warm scans emitted no Reading frame. Timings varied between runs and are not a performance benchmark.
Testing
Manual Electron QA completed on the qa-gate-admitted M4Air
Automated tests added/updated, or explained why not below
New test: a real scan where the newest file fills a limit of 1 ends with
read: { done: 1, total: 1 }. On main the same scan ends at{ done: 1, total: 2 }.Ran 6 named test files on macOS (24 tests): scan progress flow, scan progress, scan cutoff, Workspace walk, scanner service entry and the request deadline. The full PR workflow, including static analysis, all five test shards, relay integration, macOS/Windows packaging, and its aggregate gate, passed on
006b712232b1e170dd327bf3fc5c30f18baf311f.Review
Full-path correctness, architecture, dedicated performance/readiness review, and sequential plan checks found no open defect under the stated scope. Existing final-frame throttling is documented above; it is unchanged. Real Electron QA and the full PR checks are complete on the final head. Live Windows, WSL, Linux, SSH and mixed-version flows, CPU and heap measurements were not exercised; the relevant unchanged paths were source-reviewed.
Agent skill upstream boundary
Notes
Checklist