From a58a0f083dc4d71d82a6fd1d589ed4964459788a Mon Sep 17 00:00:00 2001 From: Won Park Date: Fri, 17 Apr 2026 18:05:03 -0700 Subject: [PATCH] Feat/auto review dev message marker (#18369) supporting guardian's rebrand to auto-review! --- codex-rs/protocol/src/models.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/codex-rs/protocol/src/models.rs b/codex-rs/protocol/src/models.rs index 8c55d056c..15dc3d36e 100644 --- a/codex-rs/protocol/src/models.rs +++ b/codex-rs/protocol/src/models.rs @@ -429,7 +429,7 @@ const APPROVAL_POLICY_ON_REQUEST_RULE: &str = include_str!("prompts/permissions/approval_policy/on_request.md"); const APPROVAL_POLICY_ON_REQUEST_RULE_REQUEST_PERMISSION: &str = include_str!("prompts/permissions/approval_policy/on_request_rule_request_permission.md"); -const GUARDIAN_SUBAGENT_APPROVAL_SUFFIX: &str = "`approvals_reviewer` is `guardian_subagent`: Sandbox escalations with require_escalated will be reviewed for compliance with the policy. If a rejection happens, you should proceed only with a materially safer alternative, or inform the user of the risk and send a final message to ask for approval."; +const AUTO_REVIEW_APPROVAL_SUFFIX: &str = "`approvals_reviewer` is `auto_review`: Sandbox escalations with require_escalated will be reviewed for compliance with the policy. If a rejection happens, you should proceed only with a materially safer alternative, or inform the user of the risk and send a final message to ask for approval."; const SANDBOX_MODE_DANGER_FULL_ACCESS: &str = include_str!("prompts/permissions/sandbox_mode/danger_full_access.md"); @@ -502,7 +502,7 @@ impl DeveloperInstructions { let text = if approvals_reviewer == ApprovalsReviewer::GuardianSubagent && approval_policy != AskForApproval::Never { - format!("{text}\n\n{GUARDIAN_SUBAGENT_APPROVAL_SUFFIX}") + format!("{text}\n\n{AUTO_REVIEW_APPROVAL_SUFFIX}") } else { text }; @@ -1944,7 +1944,8 @@ mod tests { ) .into_text(); - assert!(text.contains("`approvals_reviewer` is `guardian_subagent`")); + assert!(text.contains("`approvals_reviewer` is `auto_review`")); + assert!(!text.contains("`approvals_reviewer` is `guardian_subagent`")); assert!(text.contains("materially safer alternative")); } @@ -1959,6 +1960,7 @@ mod tests { ) .into_text(); + assert!(!text.contains("`approvals_reviewer` is `auto_review`")); assert!(!text.contains("`approvals_reviewer` is `guardian_subagent`")); }