mirror of
https://github.com/openai/codex.git
synced 2026-11-13 21:30:47 +00:00
Defer Guardian context limits to request preparation (#61185)
## What changed Preserve original root conversation evidence, retained instructions, assistant context, and verified answers until request preparation. Apply shared section preparation to both synchronous and asynchronous reviews, preserving fixed limits and omission notices while allowing elastic preparation to use the originals. Cache the fixed root view for reuse. Split classifier setup from final input assembly and normalize new images before deduplication and token accounting, preserving committed history. ## Testing Extend tests for fixed and elastic preparation across both review profiles, original root evidence after handoff, and image normalization during retained-request preparation. GitOrigin-RevId: 86c83384c1f5be3707622d675fc54b4c8e1ddc0a
This commit is contained in:
@@ -1304,17 +1304,13 @@ impl CodexThread {
|
||||
.authorization_version(history.as_ref())
|
||||
}
|
||||
|
||||
/// Returns bounded root conversation evidence and its authorization version atomically.
|
||||
/// Captures root originals and authorization before request-size preparation.
|
||||
pub async fn guardian_root_snapshot(&self) -> Option<GuardianRootSnapshot> {
|
||||
let mut snapshot = self
|
||||
.session
|
||||
self.session
|
||||
.services
|
||||
.agent_control
|
||||
.get_guardian_package(self.session.thread_id)
|
||||
.await?;
|
||||
// Async consumers need only the bounded projection, not the sync source snapshot.
|
||||
snapshot.request_candidates = None;
|
||||
Some(snapshot)
|
||||
.await
|
||||
}
|
||||
|
||||
/// Refresh the thread's layer-backed user config state from a caller-supplied
|
||||
|
||||
Reference in New Issue
Block a user