mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Preserve Guardian authorization evidence across checkpoint migration (#45782)
## Why Older compaction checkpoints can lack a producer model hash. Enabling thread-owned Guardian context must accommodate those checkpoints without losing user instructions or verified answers. ## What changed - Select review policy from each history snapshot independently of the session's evidence capture policy. - Keep legacy review for checkpoints with missing or empty producer hashes when the transcript preserves the evidence. Preserve strict compatibility checks when review depends on retained-only evidence. - Continue capturing retained instructions and answers during migration, while supplying legacy reviews with runtime answers and subagent reviews with root authorization evidence. - Record producer model hashes on new compactions regardless of context mode. ## Testing Add coverage for checkpoint migration across compaction and resume in both history storage modes, snapshot policy stability, retained-evidence preservation, and authorization revalidation for owning sessions and subagents. GitOrigin-RevId: ec72b4a51d40729173e24ac1b53b7d516ddaa825
This commit is contained in:
1 parent
1427825c40
commit
0c3a14bbc2
20 files changed
+564
-85
No files matched your search
@@ -103,14 +103,14 @@ impl RequestUserInputHandler {
|
||||
))
|
||||
})?;
|
||||
if turn.config.features.enabled(Feature::GuardianApproval) {
|
||||
let history = session.conversation_history_snapshot().await;
|
||||
session
|
||||
.services
|
||||
.thread_extension_data
|
||||
.get_or_init(GuardianReviewEvidence::default)
|
||||
.record_user_input(&call_id, &questions, &response);
|
||||
.record_user_input(history.as_ref(), &call_id, &questions, &response);
|
||||
}
|
||||
// Capture and consumption use the same fixed thread feature setting. Legacy
|
||||
// threads must not construct retained answers, persist them, or advance their revision.
|
||||
// Capture follows the session flag even while an older checkpoint uses legacy review.
|
||||
if turn.config.features.enabled(Feature::GuardianApproval)
|
||||
&& session.guardian_context_mode == GuardianContextMode::ThreadOwned
|
||||
{
|
||||
|
||||
@@ -117,7 +117,7 @@ async fn request_user_input_sets_non_blocking_outside_plan_mode(
|
||||
session
|
||||
.services
|
||||
.thread_extension_data
|
||||
.insert(GuardianReviewEvidence::new(session.guardian_context_mode));
|
||||
.insert(GuardianReviewEvidence::default());
|
||||
let original_history = session.conversation_history_snapshot().await;
|
||||
*session.active_turn.lock().await = Some(ActiveTurn::default());
|
||||
|
||||
|
||||
Reference in new issue
Block a user