mirror of
https://github.com/openai/codex.git
synced 2026-12-02 00:31:03 +00:00
feat: surface Guardian recovery after retry exhaustion
Co-authored-by: Codex noreply@openai.com
This commit is contained in:
co-authored by
Codex noreply@openai.com
parent
3dab5cabc9
commit
46f77df8cc
@@ -238,7 +238,7 @@ async fn record_guardian_denial(session: &Arc<Session>, turn: &Arc<TurnContext>,
|
||||
turn.as_ref(),
|
||||
EventMsg::GuardianWarning(WarningEvent {
|
||||
message: format!(
|
||||
"Automatic approval review rejected too many approval requests for this turn ({consecutive_denials} consecutive, {recent_denials} in the last {AUTO_REVIEW_DENIAL_WINDOW_SIZE} reviews); interrupting the turn."
|
||||
"Automatic approval review rejected too many approval requests for this turn ({consecutive_denials} consecutive, {recent_denials} in the last {AUTO_REVIEW_DENIAL_WINDOW_SIZE} reviews); interrupting the turn. Run /approve to review eligible soft denials, or add context and retry with a safer action."
|
||||
),
|
||||
}),
|
||||
)
|
||||
|
||||
@@ -8405,6 +8405,14 @@ async fn guardian_auto_review_interrupts_after_three_consecutive_denials() {
|
||||
)
|
||||
});
|
||||
assert_eq!(aborted.reason, TurnAbortReason::Interrupted);
|
||||
assert!(observed.iter().any(|event| {
|
||||
matches!(
|
||||
event,
|
||||
EventMsg::GuardianWarning(event)
|
||||
if event.message.contains("Run /approve")
|
||||
&& event.message.contains("eligible soft denials")
|
||||
)
|
||||
}));
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
|
||||
Reference in New Issue
Block a user