Skip to content

Read compressed rollouts and materialize before append#25087

Merged
jif-oai merged 10 commits into
mainfrom
jif/rollout-compressed-readers
Jun 1, 2026
Merged

Read compressed rollouts and materialize before append#25087
jif-oai merged 10 commits into
mainfrom
jif/rollout-compressed-readers

Conversation

@jif-oai
Copy link
Copy Markdown
Collaborator

@jif-oai jif-oai commented May 29, 2026

Why

Local rollout compression needs a cold .jsonl.zst representation without letting compressed physical paths leak into append-mode writers. The unsafe case is resume or metadata update code successfully reading a compressed rollout and then appending raw JSONL bytes to the zstd file.

This PR folds the former #25088 materialization slice into the read-support PR so the reader changes and append-safety invariant land together.

What Changed

  • Teach rollout readers, discovery, listing, search, and ID lookup to understand compressed .jsonl.zst rollouts.
  • Keep .jsonl as the logical/stored rollout path while allowing read paths to open either plain or compressed storage.
  • Materialize compressed rollouts back to plain .jsonl before append-mode writes, including resume and direct metadata append paths.
  • Preserve compressed-file permissions when materializing back to plain JSONL.
  • Refresh thread-store resolved rollout paths after compatibility metadata writes so reconciliation follows the materialized file.
  • Avoid treating transient compression temp files as real rollout lookup results.

Remaining Stack

#25089 remains the separate worker PR. It is based directly on this PR and stays behind the disabled local_thread_store_compression feature flag.

The worker still has a broader coordination question: a resume or metadata update can race with background compression while a plain file is being replaced by .jsonl.zst. This PR handles the read and materialize-before-append primitives; it does not make the worker production-ready.

Validation

  • just test -p codex-rollout
  • just test -p codex-thread-store
  • just fix -p codex-rollout
  • just fix -p codex-thread-store
  • just bazel-lock-check

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 29, 2026

@codex review

@jif-oai jif-oai marked this pull request as ready for review May 29, 2026 12:36
Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e6f6a17e8a

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/thread-store/src/local/read_thread.rs
Comment thread codex-rs/rollout/Cargo.toml
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 29, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Bravo.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented May 29, 2026

Clippy failure is due to dead_code that is corrected by the PR stack

@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Jun 1, 2026

@codex review

Copy link
Copy Markdown
Contributor

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 005c818463

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread codex-rs/rollout/src/list.rs
Comment thread codex-rs/rollout/src/recorder.rs
@jif-oai jif-oai changed the title Read compressed local rollouts Read compressed rollouts and materialize before append Jun 1, 2026
@jif-oai
Copy link
Copy Markdown
Collaborator Author

jif-oai commented Jun 1, 2026

@codex review

@chatgpt-codex-connector
Copy link
Copy Markdown
Contributor

Codex Review: Didn't find any major issues. Delightful!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@jif-oai jif-oai merged commit a8a6071 into main Jun 1, 2026
31 checks passed
@jif-oai jif-oai deleted the jif/rollout-compressed-readers branch June 1, 2026 13:14
@github-actions github-actions Bot locked and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant