mirror of
https://github.com/openai/codex.git
synced 2026-08-23 13:09:46 +00:00
Hide approved automatic review warnings in the TUI (#39605)
## What changed - Ignore Guardian warning notifications that report a successful automatic approval review, keeping approved reviews out of TUI history. - Continue displaying all other Guardian warnings. - Extend the approved-review history test to cover the notification path. GitOrigin-RevId: 719e84bc5b20c0a5364d10f84be9c6ac96158719
This commit is contained in:
@@ -154,7 +154,12 @@ impl ChatWidget {
|
||||
}
|
||||
ServerNotification::Warning(notification) => self.on_warning(notification.message),
|
||||
ServerNotification::GuardianWarning(notification) => {
|
||||
self.on_warning(notification.message)
|
||||
if !notification
|
||||
.message
|
||||
.starts_with("Automatic approval review approved (")
|
||||
{
|
||||
self.on_warning(notification.message);
|
||||
}
|
||||
}
|
||||
ServerNotification::DeprecationNotice(notification) => {
|
||||
self.on_deprecation_notice(notification.summary, notification.details)
|
||||
|
||||
@@ -163,6 +163,13 @@ async fn guardian_approved_exec_is_hidden_from_history() {
|
||||
let (mut chat, mut rx, _op_rx) = make_chatwidget_manual(/*model_override*/ None).await;
|
||||
chat.show_welcome_banner = false;
|
||||
|
||||
chat.handle_server_notification(
|
||||
ServerNotification::GuardianWarning(GuardianWarningNotification {
|
||||
thread_id: "thread-1".to_string(),
|
||||
message: "Automatic approval review approved (risk: low, authorization: high): Narrowly scoped to the requested file.".to_string(),
|
||||
}),
|
||||
/*replay_kind*/ None,
|
||||
);
|
||||
chat.on_guardian_assessment(GuardianAssessmentEvent {
|
||||
id: "thread:child-thread:guardian-1".into(),
|
||||
target_item_id: Some("guardian-approved-target".into()),
|
||||
|
||||
Reference in New Issue
Block a user