Skip to content

Allow model-facing ID sequences to resume from allocated IDs - #60732

Merged
copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6cbb725c0bd08356c0dc5458021b9bf58a489522
Nov 11, 2026
Merged

copyberry[bot] merged 1 commit into
mainfrom
copyberry/codex-internal-to-codex-oss/6cbb725c0bd08356c0dc5458021b9bf58a489522

Conversation

@copyberry

@copyberry copyberry Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Allow model-facing ID sequences to resume from allocated IDs

Why

Resuming an ID sequence from a persisted ID requires its allocation position before shuffling. Previously, IDs stored only their salt and shuffled value.

What changed

  • Store the allocation ordinal in ModelFacingId, expose salt() and ordinal(), and derive JsonSchema.
  • Add ModelFacingIdGenerator::starting_at() and next_ordinal() so callers can resume with the original seed and salt at the next allocation position without a generator snapshot.

Testing

Update serialization coverage for the allocation fields and add a test that resumes from a serialized ID across the three-digit pool boundary, matching the uninterrupted sequence.

## Why

Resuming an ID sequence from a persisted ID requires its allocation position before shuffling. Previously, IDs stored only their salt and shuffled value.

## What changed

- Store the allocation `ordinal` in `ModelFacingId`, expose `salt()` and `ordinal()`, and derive `JsonSchema`.
- Add `ModelFacingIdGenerator::starting_at()` and `next_ordinal()` so callers can resume with the original seed and salt at the next allocation position without a generator snapshot.

## Testing

Update serialization coverage for the allocation fields and add a test that resumes from a serialized ID across the three-digit pool boundary, matching the uninterrupted sequence.

GitOrigin-RevId: 6cbb725c0bd08356c0dc5458021b9bf58a489522
@copyberry
copyberry Bot force-pushed the copyberry/codex-internal-to-codex-oss/6cbb725c0bd08356c0dc5458021b9bf58a489522 branch from 03af49f to ce6f7d9 Compare November 11, 2026 06:30
@copyberry
copyberry Bot merged commit ce6f7d9 into main Nov 11, 2026
8 of 23 checks passed
@copyberry
copyberry Bot deleted the copyberry/codex-internal-to-codex-oss/6cbb725c0bd08356c0dc5458021b9bf58a489522 branch November 11, 2026 06:30
@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-11T06:30:22.819731Z 03af49f 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.

This branch was previously deployed

1 inactive deployment
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.

4 participants