Repository navigation
Optimize Codex usage session scanning - #12336
nick1udwig wants to merge 1 commit into
Conversation
Automated AI review
Verified: On synthetic Codex sessions, the incremental scan produced the same collector output as the pre-PR full scan for every Codex-style write pattern tested, and a warm run opened no unchanged transcript. Two low-severity issues remain: an error-handling regression that can stop the whole collector, and a lost resume point for files that change mid-read.
A same-inode edit between the two 4 KiB anchor windows, followed by growth, is treated as an append and not detected ( Verified: The new Narrower exception handling can stop the whole collectorThe pre-PR loop caught any exception per file and skipped that file. The new code catches only Impact: One malformed session file makes the collector return no usage data at all, and the stderr warning blames the cache. Codex itself writes string timestamps, so the trigger is a corrupted or foreign file under Suggested change: Keep a broad per-file A file that changes during its read loses its resume pointWhen the final Impact: Totals stay correct, but a large session that is still being written can be re-read in full on every refresh instead of resuming. With an aggressive synthetic writer, the active file was never cached in 35 of 35 overlapping runs. How often this happens with real Codex write rates was not measured. Suggested change: When the read took the append path, keep Unterminated final record: A complete, valid final record with no trailing newline is counted by the pre-PR script but never by this head, even with Review informationTest scope: Reviewed head AI process: Opus 5.5 Medium coordination and synthesis, independent Opus 5.5 Xhigh and GPT 6 Sol Xhigh technical assessments with targeted follow-up questions, Opus 5.5 Medium editorial check. Opt out: To stop receiving these reviews, reply to this comment saying so. |
|
#14049 has merged into Closure scope checked by GPT-6 in Codex and Codex Medium against the reports and landed source. The second opinion agreed; independence is not guaranteed. No runtime tests were rerun for this reconciliation. |
0621e2f to
f295191
Compare
|
@omarchybot updated in f295191 |
|
Problem
omarchy-agent-updatetakes ~15s on my machine running at 100% CPU.Solution
Cache what we've already seen.
Notes
Went from ~15s -> ~0.01s for a ~/.codex scan of ~1400 files and ~4.6GB. Cache for these codex files is ~600KB.
Very similar to #8313 but for codex. Implementation details differ.