mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Consolidate Guardian tests at shared policy and context boundaries (#46064)
## What changed - Move approval routing tests into `guardian-reviewer`, covering both reviewer choices across `UnlessTrusted`, `OnRequest`, `Granular`, and `Never` without host session setup. - Combine reviewer configuration checks into one test for isolation from parent customizations. - Cover filtering of ordinary developer messages while preserving manual approvals in `guardian-context`, removing the duplicate async scorer test. GitOrigin-RevId: b39ef21475e2f5d99d758f2d27615449b252dc65
This commit is contained in:
1 parent
e412b93d08
commit
08663cc91b
6 files changed
+85
-209
No files matched your search
@@ -1078,50 +1078,6 @@ fn configured_reasoning_counts_against_message_budget() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transcript_keeps_only_manual_approval_developer_messages() {
|
||||
let approval_text = format!("{MANUAL_APPROVAL_DEVELOPER_PREFIX}\n\nApproved action:\n{{}}");
|
||||
let items = vec![
|
||||
ResponseItem::Message {
|
||||
id: None,
|
||||
role: "developer".to_string(),
|
||||
content: vec![ContentItem::InputText {
|
||||
text: "ordinary developer context".to_string(),
|
||||
}],
|
||||
phase: None,
|
||||
internal_chat_message_metadata_passthrough: None,
|
||||
},
|
||||
ResponseItem::Message {
|
||||
id: None,
|
||||
role: "developer".to_string(),
|
||||
content: vec![ContentItem::InputText {
|
||||
text: approval_text.clone(),
|
||||
}],
|
||||
phase: None,
|
||||
internal_chat_message_metadata_passthrough: None,
|
||||
},
|
||||
];
|
||||
|
||||
let transcript = TranscriptConfig::default()
|
||||
.build_context(ContextInput {
|
||||
target: ContextTarget::Async,
|
||||
history: &TestConversationHistory(&items),
|
||||
root_conversation: &[],
|
||||
trusted_user_answers: &[],
|
||||
planned_action: None,
|
||||
previous_reviews: None,
|
||||
trusted_tool: None,
|
||||
trusted_skill_paths: &[],
|
||||
node_repl_images: None,
|
||||
})
|
||||
.expect("collect transcript")
|
||||
.transcript_entries();
|
||||
assert_eq!(
|
||||
transcript,
|
||||
vec![format!("[1] developer: {approval_text}\n")]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn transcript_omits_media_payloads_and_keeps_readable_content() {
|
||||
let oversized_image =
|
||||
|
||||
Reference in new issue
Block a user