Skip to content

armgit / codex

Public Imported from GitHub
0

Lightweight coding agent that runs in your terminal

Rust

Hide approved automatic review warnings in the TUI (#39605)

Eric Traut430bc36fb235
diff --git a/codex-rs/tui/src/chatwidget/protocol.rs b/codex-rs/tui/src/chatwidget/protocol.rs
index f1beab046b..7e687f332b 100644
--- a/codex-rs/tui/src/chatwidget/protocol.rs
+++ b/codex-rs/tui/src/chatwidget/protocol.rs
@@ -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)
diff --git a/codex-rs/tui/src/chatwidget/tests/guardian.rs b/codex-rs/tui/src/chatwidget/tests/guardian.rs
index 5956af872e..ee483ed06f 100644
--- a/codex-rs/tui/src/chatwidget/tests/guardian.rs
+++ b/codex-rs/tui/src/chatwidget/tests/guardian.rs
@@ -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()),