mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
guardian timeout fix pr 3 - ux touch for timeouts (#17557)
This PR teaches the TUI to render guardian review timeouts as explicit terminal history entries instead of dropping them from the live timeline. It adds timeout-specific history cells for command, patch, MCP tool, and network approval reviews. It also adds snapshot tests covering both the direct guardian event path and the app-server notification path.
This commit is contained in:
1 parent
280a4a6d42
commit
495ed22dfb
5 files changed
+265
No files matched your search
@@ -3423,6 +3423,42 @@ impl ChatWidget {
|
||||
return;
|
||||
}
|
||||
|
||||
if ev.status == GuardianAssessmentStatus::TimedOut {
|
||||
let cell = if let Some(command) = guardian_command(&ev.action) {
|
||||
history_cell::new_approval_decision_cell(
|
||||
command,
|
||||
codex_protocol::protocol::ReviewDecision::TimedOut,
|
||||
history_cell::ApprovalDecisionActor::Guardian,
|
||||
)
|
||||
} else {
|
||||
match &ev.action {
|
||||
GuardianAssessmentAction::ApplyPatch { files, .. } => {
|
||||
let files = files
|
||||
.iter()
|
||||
.map(|path| path.display().to_string())
|
||||
.collect::<Vec<_>>();
|
||||
history_cell::new_guardian_timed_out_patch_request(files)
|
||||
}
|
||||
GuardianAssessmentAction::McpToolCall {
|
||||
server, tool_name, ..
|
||||
} => history_cell::new_guardian_timed_out_action_request(format!(
|
||||
"codex could call MCP tool {server}.{tool_name}"
|
||||
)),
|
||||
GuardianAssessmentAction::NetworkAccess { target, .. } => {
|
||||
history_cell::new_guardian_timed_out_action_request(format!(
|
||||
"codex could access {target}"
|
||||
))
|
||||
}
|
||||
GuardianAssessmentAction::Command { .. } => unreachable!(),
|
||||
GuardianAssessmentAction::Execve { .. } => unreachable!(),
|
||||
}
|
||||
};
|
||||
|
||||
self.add_boxed_history(cell);
|
||||
self.request_redraw();
|
||||
return;
|
||||
}
|
||||
|
||||
if ev.status != GuardianAssessmentStatus::Denied {
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user