mirror of
https://github.com/openai/codex.git
synced 2026-11-28 23:34:06 +00:00
Attach failed Guardian reviews to diagnostic reports (#41936)
## What changed - Retain bounded, process-local records for failed Guardian reviews, including the reviewed action, decision, status, model, instructions, and reviewer history. - Add recent records from the reported thread and its descendants to log-enabled report uploads as `auto-review-failures.jsonl`. - Preserve the action and decision while omitting oversized reviewer context, and exclude successful, ephemeral, and capture-disabled reviews. ## Testing - Cover denied and invalid decisions, cleaned-up ephemeral reviewers, descendant-thread selection, record count and byte limits, and oversized-context fallback. GitOrigin-RevId: 5f12f7605041c3c84e826e6bac1cf06b1518ab24
This commit is contained in:
1 parent
981d6b652b
commit
13d75cd1c3
12 files changed
+439
-13
No files matched your search
@@ -6,6 +6,7 @@ use codex_feedback::CODEX_APP_DIRECTORY_CACHE_ATTACHMENT_FILENAME;
|
||||
use codex_feedback::CODEX_APPS_TOOLS_CACHE_ATTACHMENT_FILENAME;
|
||||
#[cfg(target_os = "windows")]
|
||||
use codex_feedback::WINDOWS_SANDBOX_LOG_ATTACHMENT_FILENAME;
|
||||
use codex_feedback::guardian_review_failures_attachment;
|
||||
use codex_rollout::RolloutRecorder;
|
||||
use sha2::Digest;
|
||||
use sha2::Sha256;
|
||||
@@ -108,6 +109,7 @@ impl FeedbackRequestProcessor {
|
||||
}
|
||||
let snapshot = self.feedback.snapshot(conversation_id);
|
||||
let thread_id = snapshot.thread_id.clone();
|
||||
let mut extra_attachments = Vec::new();
|
||||
let (feedback_thread_ids, sqlite_feedback_logs, state_db_ctx) = if include_logs {
|
||||
if let Some(log_db) = self.log_db.as_ref() {
|
||||
log_db.flush().await;
|
||||
@@ -129,6 +131,7 @@ impl FeedbackRequestProcessor {
|
||||
},
|
||||
None => Vec::new(),
|
||||
};
|
||||
extra_attachments.extend(guardian_review_failures_attachment(&feedback_thread_ids));
|
||||
let mut feedback_thread_ids = feedback_thread_ids;
|
||||
let original_len = feedback_thread_ids.len();
|
||||
if let Some(conversation_id) = conversation_id {
|
||||
@@ -243,7 +246,6 @@ impl FeedbackRequestProcessor {
|
||||
}
|
||||
}
|
||||
|
||||
let mut extra_attachments = Vec::new();
|
||||
if include_logs {
|
||||
let doctor_cwd = feedback_cwd(
|
||||
&self.thread_manager,
|
||||
|
||||
Reference in new issue
Block a user