Skip to content

Read rollout reference histories - #27968

Closed
friel-openai wants to merge 5 commits into
mainfrom
dev/friel/rollout-reference-readers
Closed

friel-openai wants to merge 5 commits into
mainfrom
dev/friel/rollout-reference-readers

Conversation

@friel-openai

@friel-openai friel-openai commented Jun 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Add the existing RolloutReferenceItem wire format and immutable SegmentId reader support.
  • Separate bounded model replay from fallible complete-history reconstruction.
  • Read predecessor segments in thread listing, app-server transcript APIs, memory extraction, and feedback attachments.
  • Reject legacy references when resolving them would substitute a newer live segment.

Context

This is the reader prerequisite split from #27249 after review identified persistence and rotation concerns in that PR. Existing Frodex rollouts already contain rollout_reference and legacy fork_reference items, so decoding and read compatibility are useful independently of enabling Session segmentation.

This PR does not declare the Session segmentation feature and has no production RolloutReferenceItem constructor. It does not add a database migration. The serialized fields, defaults, and fork_reference alias are unchanged from #27249 at ffbd02abb5.

Read contracts

  • segment_id is authoritative. Resolution validates the target file's SessionMeta.segment_id and does not fall back to a same-named live file with different content.
  • A path-only legacy reference checks the plain or compressed archived predecessor before the mutable live path. A segment-identified live successor is rejected rather than spliced into history.
  • Model replay applies the reference depth budget. Complete transcript consumers ignore that model budget, detect cycles, and return an error instead of silently dropping an unreadable predecessor.
  • Thread search attributes segment predecessors to the current thread. Prefix-truncated fork history remains searchable through its source thread, avoiding duplicate child results.

The feature flag, per-thread writer transaction, atomic canonical-file replacement, immutable reference publication, and reachability-based deletion belong to writer follow-up #27249.

Test plan

  • RUST_MIN_STACK=8388608 cargo test -p codex-rollout (85 passed)
  • RUST_MIN_STACK=8388608 cargo test -p codex-thread-store (80 passed)
  • RUST_MIN_STACK=8388608 cargo test -p codex-app-server-protocol (228 unit and 2 schema fixture tests passed)
  • RUST_MIN_STACK=8388608 cargo test -p codex-memories-write (36 passed)
  • RUST_MIN_STACK=8388608 cargo test -p codex-app-server --lib (248 passed)
  • RUST_MIN_STACK=8388608 cargo test -p codex-core thread_rollout_truncation::tests (20 passed)
  • Focused disabled-feature thread/resume, unloaded thread/read, feedback attachment, interrupted-fork, and identity-validation fixture tests passed
  • Scoped just fix for the six changed crates
  • Argument-comment lint passed for 547 normal and 127 manual Bazel targets

Separate bounded model replay from fallible complete-history reconstruction, validate immutable segment resolution, and make app-server, search, memory, and feedback readers reference-aware.
@friel-openai friel-openai added the codex Label used by connector to tag PRs that have been reviewed by Codex label Jun 12, 2026
@friel-openai
friel-openai marked this pull request as ready for review June 13, 2026 00:23
@friel-openai
friel-openai requested a review from a team as a code owner June 13, 2026 00:23

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

Copy link
Copy Markdown
Contributor

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: 2852e3b9d1

ℹ️ 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/core/src/thread_rollout_truncation.rs
Comment thread codex-rs/memories/write/src/phase1.rs
Comment thread codex-rs/core/src/session/rollout_reconstruction.rs
@github-actions

Copy link
Copy Markdown
Contributor

Closing this pull request because it has had no updates for more than 14 days. If you plan to continue working on it, feel free to reopen or open a new PR.

@github-actions github-actions Bot closed this Jun 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

codex Label used by connector to tag PRs that have been reviewed by Codex

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant