mirror of
https://github.com/openai/codex.git
synced 2026-11-15 21:50:46 +00:00
Preserve thread-local model ID state across replay and compaction (#60942)
## 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
This commit is contained in:
committed by
copyberry
parent
c93732887e
commit
77cbcdb4a6
@@ -1,9 +1,9 @@
|
||||
//! Response item ID generation shared by sessions and their consumers.
|
||||
//! Response item ID allocation for a thread and its consumers.
|
||||
|
||||
use crate::ResponseItemId;
|
||||
use std::sync::Arc;
|
||||
|
||||
/// Generates response item IDs from a type prefix for an owning session. Clones share the same callable.
|
||||
/// Generates IDs for an item kind. Clones share the owning thread's sequence.
|
||||
pub type ItemIdGenerator = Arc<dyn Fn(&str) -> ResponseItemId + Send + Sync>;
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in New Issue
Block a user