Skip to content

Preserve thread-local model ID state across replay and compaction - #60942

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7121b747a039dc5477235078702137d1ff74e789
Nov 12, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/7121b747a039dc5477235078702137d1ff74e789

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Preserve thread-local model ID state across replay and compaction

What changed

  • Initialize item and context-window ID generators per thread, reuse the stored window on resume, and give history reconstruction a separate item generator.
  • Recover item ordinals from checkpoint replacement history, guardian history, and retained context without lowering the cursor established by earlier records.
  • Stamp compaction resume metadata with the next item ordinal in append order, tracking the cursor in local and in-memory thread stores.

Testing

Extend the history ordinal test to verify that a checkpoint records the cursor at its position in a batch, excluding later allocations.

…0942)

## What changed

- Initialize item and context-window ID generators per thread, reuse the stored window on resume, and give history reconstruction a separate item generator.
- Recover item ordinals from checkpoint replacement history, guardian history, and retained context without lowering the cursor established by earlier records.
- Stamp compaction resume metadata with the next item ordinal in append order, tracking the cursor in local and in-memory thread stores.

## Testing

Extend the history ordinal test to verify that a checkpoint records the cursor at its position in a batch, excluding later allocations.

GitOrigin-RevId: 7121b747a039dc5477235078702137d1ff74e789
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/7121b747a039dc5477235078702137d1ff74e789 branch from 698e726 to 77cbcdb Compare November 12, 2026 00:27
@copyberry
copyberry Bot merged commit 77cbcdb into main Nov 12, 2026
8 of 23 checks passed
@chatgpt-codex-connector

Copy link
Copy Markdown
Contributor
Codex Review Summary: 🔄 Running

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review 🔄 Running since 2026-11-12T00:27:27.579931Z 698e726 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/7121b747a039dc5477235078702137d1ff74e789 branch November 12, 2026 00:27
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 12, 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