Repository navigation
fix(codex): dedupe archive mirrors and adopt 0.81 caches - #1
Merged
BananaIIya merged 1 commit intoOct 27, 2026
Merged
Conversation
Paged discovery skips the missing-file cleanup that removes a plain row after Codex archives it, so a cached plain rollout and its newly scanned mirror could both contribute. Drop the plain row once its mirror has been fully processed. Also accept the 0.81.0 parser hash so existing caches are adopted in place instead of rebuilt, add regression coverage for both behaviors, and regenerate the parser hash.
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.
This is a follow-up to steipete#4534, based on @BananaIIya's request.
While testing the original PR against CodexBar 0.81.0 and the latest
main, I ran into a couple of issues that needed fixing. This PR addresses those issues and applies cleanly tofix/codex-zst-sessionsat2914f1a.What I fixed
dropCodexPlainRowsSupersededByScannedArchivesso the old entry is removed once the archived version has been fully processed. In the regression test, this brought the count down from 660 tokens to the correct 330.4e1358d00a4a47b5to the list of compatible predecessor hashes. This lets users upgrading from 0.81.0 keep their existing cache instead of rebuilding it. I verified that the cache was reused without changing its inode or triggering a rebuild.634d9513ef18c251).Testing
All 103 focused tests passed, and
Scripts/regenerate-codex-parser-hash.sh --checkcompleted successfully.I also tested the changes against a real 0.81.0 cache. It was reused successfully, and the recovered token count increased from 595,497,788 to 3,681,203,325. The scan covered 32 days, 382 files, and 62 daily aggregates, with full coverage established after eight refreshes.
The patch applies cleanly to
2914f1a. I also resolved the three conflicts against upstreammainlocally.All verification was done without modifying any live
~/.codexdata, the installed app, or the original cache.I left the vendored zstd dependency and decoded-mirror storage approach unchanged, since those are still decisions for the maintainers.