Skip to content

fix(codex): read Zstandard-compressed rollouts - #1786

Merged
iamtoruk merged 1 commit into
mainfrom
fix/codex-zstd-rollouts
Oct 26, 2026
Merged

iamtoruk merged 1 commit into
mainfrom
fix/codex-zstd-rollouts

Conversation

@iamtoruk

@iamtoruk iamtoruk commented Oct 21, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Codex now moves cold rollouts to rollout-*.jsonl.zst, which CodeBurn skipped, so most Codex history disappeared from reports. Every Codex reader (discovery, parser, fork lookup, codex-tps, context view) now decodes them.
  • A session present in both forms counts once, from the plain file. Compressed files are parsed whole and never resumed by byte offset. A damaged .zst prints a visible warning; usage after the damaged part is not counted.
  • On Node below 22.15 (no node:zlib zstd), compressed rollouts are skipped with one notice. Results there match current main, and the daily cache stays at version 75, so a later Node upgrade adopts it and re-derives the settled days.
  • With zstd, DAILY_CACHE_VERSION goes to 76 so settled days pick up the recovered usage.

Testing / Verification

  • I have tested this locally against real data (not just unit tests)
  • npm test passes
  • npm run build succeeds
  • Not a UI change

Real ~/.codex with 1,436 compressed and 6 plain rollouts, 2026-01-01 to 2026-10-25:

Sessions Calls Cost
main 3 54 $0.16
this branch 1,358 51,564 $4,842.39
  • The same files decompressed and read by main give a byte-identical export.
  • With zstd hidden from node:zlib, the export matches main exactly, prints the notice once and writes a v75 cache; the next run with zstd adopts it and reaches $4,842.39.
  • A daily cache written after compression goes from $0.16 to $4,842.39 on the first run. A cache written before compression keeps its totals, with 0 days changed.
  • Eight plain/compressed transitions on the same session set (compress, delete, both forms present, back to plain, fresh cache each time) give identical totals.

@ozymandiashh ozymandiashh added area: cli The codeburn CLI and its core parsing/reporting engine bug Something isn't working provider: codex Codex CLI provider labels Oct 24, 2026
@iamtoruk
iamtoruk force-pushed the fix/codex-zstd-rollouts branch from 24d43bf to 6682c9f Compare October 26, 2026 01:21
Codex now moves cold rollouts to rollout-*.jsonl.zst. Discovery, the
first-line probe, the parser, fork parent lookup, codex-tps and the context
view read them through a zstd decode; a session present in both forms
counts once from the plain file. Compressed files are parsed whole and never
resumed by byte offset. Without node:zlib zstd (Node < 22.15) they are
skipped with one notice. DAILY_CACHE_VERSION 76 so settled days pick up the
recovered Codex usage. Without zstd it stays 75, so a later Node upgrade
still adopts that cache and re-derives it.
@iamtoruk
iamtoruk force-pushed the fix/codex-zstd-rollouts branch from 6682c9f to aa73cd6 Compare October 26, 2026 01:26
@iamtoruk
iamtoruk merged commit b497435 into main Oct 26, 2026
23 checks passed
@iamtoruk
iamtoruk deleted the fix/codex-zstd-rollouts branch October 26, 2026 01:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli The codeburn CLI and its core parsing/reporting engine bug Something isn't working provider: codex Codex CLI provider

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants