Skip to content

fix: read compressed Codex session logs - #64

Open
CodeDestiny wants to merge 1 commit into
shanggqm:mainfrom
CodeDestiny:fix/compressed-codex-history
Open

CodeDestiny wants to merge 1 commit into
shanggqm:mainfrom
CodeDestiny:fix/compressed-codex-history

Conversation

@CodeDestiny

Copy link
Copy Markdown

Summary

Codex can replace session JSONL files with .jsonl.zst while its SQLite locator still points to the original file. The history index then retries a missing path or feeds compressed bytes to the JSONL parser, leaving token history incomplete.

Codex locator → existing JSONL or exact .zst sibling → private decoded mirror → incremental parser
  • Keep logical source IDs and decompressed offsets; fingerprint the compressed file and rebuild older compressed generations without double counting.
  • Reuse at most one mirror per parser slot, allow live plaintext work between batches, and remove helper directories before stop completes.
  • Document the Homebrew zstd dependency and run compressed history regressions in macOS CI.

Evidence

  • Before: the compressed synthetic counter fixture never completes history coverage.
  • After: the same fixture completes with 175 tokens; restarting reads zero parser body bytes. Replacement, corruption, live-job fairness and stop cleanup have regression coverage.

Validation

  • make build (arm64, macOS 26.5 SDK, whole-module optimization).
  • CODEXU_SKIP_BUILD=1 ./scripts/test-history-index.sh — all 14 history checks and 8 related suites passed.
  • --probe-history-index against an isolated synthetic home and fresh cache.
  • --dump-json against the same synthetic home.
  • git diff --check; both modified workflows parse as valid YAML.

Privacy Check

  • Only synthetic fixtures are used in this PR; no private thread titles, local paths, screenshots, account data or local databases are included.
  • Original logs stay read-only. Decoding is local, with private temporary files and no new network behavior.

Merge Danger

Door: two-way. This changes derived index generations, not the database schema or original session logs.

Blast Radius: macOS history ingestion. Compressed sessions require Homebrew zstd; Intel hardware and release packages were not exercised locally.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant