Skip to content

fix: import Zstandard-compressed Codex rollouts - #5

Open
KKeygen wants to merge 1 commit into
Walvez:mainfrom
KKeygen:fix/read-compressed-codex-rollouts
Open

KKeygen wants to merge 1 commit into
Walvez:mainfrom
KKeygen:fix/read-compressed-codex-rollouts

Conversation

@KKeygen

@KKeygen KKeygen commented Oct 20, 2026

Copy link
Copy Markdown

Codex history stored as rollout-*.jsonl.zst is silently absent from the import picker and batch imports because discovery only accepts .jsonl. This can make most historical conversations disappear from the catalog even though their local records still exist.

This change discovers and decodes compressed rollouts without rewriting source files. It uses native Node Zstandard when available and the existing zstd CLI dependency on older Node versions. Native synchronous decoding consumes one frame at a time, so concatenated frames are explicitly decoded through EOF. Plain and compressed copies of the same rollout are counted once, while distinct continuation segments remain available for the existing merge logic.

The configured size limit applies to both stored and decoded bytes. Oversized decoded histories count as oversized in the picker, importer, and doctor; corrupt compressed files count as unreadable and do not abort the batch.

Validation:

  • npm test: 66 passed, 0 failed, 0 skipped.
  • The same 66 tests passed using the actual DSH desktop host executable (Electron 44.0.0 / Node 24.18.1).
  • Five new compression regression tests also passed on Node 20, exercising the CLI fallback: Unicode and concatenated-frame parity, dual-copy deduplication, continuation merging, idempotent import, subagent filtering, combined decoded-size bounds, and corrupt later-frame checksums.
  • A read-only local smoke check discovered previously omitted compressed rollouts and parsed a real compressed conversation; source checksum was unchanged. No private conversation data is included in this PR.
  • Syntax checks, git diff --check, and npm pack --dry-run passed.

Tests import synthetic histories into isolated persistence fixtures. This PR does not claim live GUI acceptance or deploy changes to a running profile.

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