mirror of
https://github.com/openai/codex.git
synced 2026-11-24 23:20:47 +00:00
Direct Guardian to read user instructions before its first verdict (#63513)
## Why The pending action omits the user's instructions, so even an apparently low-risk action can be reviewed without the context needed for a verdict. ## What changed The default Guardian board guidance now tells the reviewer to list channels, subscribe to the relevant channel if needed, and read the user's original instructions before its first verdict on each task. For later reviews, it directs the reviewer to use subscription updates and look up missing or potentially stale instructions. ## Testing Update assertions to check that blank retrieval instructions use the new default and that custom retrieval instructions override it. GitOrigin-RevId: e574ac72201c933c203d6ac48bb0b1019488584f
This commit is contained in:
@@ -40,9 +40,13 @@ pub fn board_retrieval(instructions: Option<&str>) -> codex_core::guardian_revie
|
||||
let strategy = instructions
|
||||
.map(str::trim)
|
||||
.filter(|text| !text.is_empty())
|
||||
.unwrap_or(
|
||||
"Use the guardian_board tools when you need more evidence for the exact action.",
|
||||
);
|
||||
.unwrap_or(concat!(
|
||||
"Before your first verdict for each task, use the Guardian board even if the action appears low risk. ",
|
||||
"The pending action does not include the user's instructions. ",
|
||||
"Call guardian_board.get_channels, then call guardian_board.subscribe for the relevant channel ",
|
||||
"if you do not already follow it. Read the user's original instructions there. ",
|
||||
"On later reviews, use the subscribed updates and look up any missing or possibly stale instructions.",
|
||||
));
|
||||
let board_rules = concat!(
|
||||
"Search or read any live channel, including channels you do not follow. ",
|
||||
"Use subscribed_channels to see which channels you follow. Subscribe or unsubscribe to manage which channels feed new originals to this conversation. ",
|
||||
|
||||
@@ -1184,7 +1184,7 @@ async fn subscribed_evidence_reaches_the_retained_reviewer_when_it_becomes_idle(
|
||||
assert!(routing_request.instructions_text().contains(ROUTING));
|
||||
let instructions = request.instructions_text();
|
||||
assert!(instructions.contains(RETRIEVAL));
|
||||
assert!(!instructions.contains("Use the guardian_board tools when you need more evidence"));
|
||||
assert!(!instructions.contains("call guardian_board.subscribe"));
|
||||
assert!(instructions.contains("Subscribing does not fetch a channel's earlier posts"));
|
||||
assert!(instructions.contains("carries the same authority as that message"));
|
||||
assert!(instructions.contains(
|
||||
|
||||
@@ -72,7 +72,7 @@ async fn blank_retrieval_instructions_use_default_board_guidance() -> anyhow::Re
|
||||
})
|
||||
.await;
|
||||
let instructions = response.single_request().instructions_text();
|
||||
assert!(instructions.contains("Use the guardian_board tools when you need more evidence"));
|
||||
assert!(instructions.contains("call guardian_board.subscribe"));
|
||||
assert!(!instructions.contains(V2_HISTORY_PROMPT));
|
||||
|
||||
spawned.thread.shutdown_and_wait().await?;
|
||||
|
||||
Reference in New Issue
Block a user