mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Feat/auto review dev message marker (#18369)
supporting guardian's rebrand to auto-review!
This commit is contained in:
1 parent
93ff798e5b
commit
a58a0f083d
1 file changed
+5
-3
@@ -429,7 +429,7 @@ const APPROVAL_POLICY_ON_REQUEST_RULE: &str =
|
|||||||
include_str!("prompts/permissions/approval_policy/on_request.md");
|
include_str!("prompts/permissions/approval_policy/on_request.md");
|
||||||
const APPROVAL_POLICY_ON_REQUEST_RULE_REQUEST_PERMISSION: &str =
|
const APPROVAL_POLICY_ON_REQUEST_RULE_REQUEST_PERMISSION: &str =
|
||||||
include_str!("prompts/permissions/approval_policy/on_request_rule_request_permission.md");
|
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 =
|
const SANDBOX_MODE_DANGER_FULL_ACCESS: &str =
|
||||||
include_str!("prompts/permissions/sandbox_mode/danger_full_access.md");
|
include_str!("prompts/permissions/sandbox_mode/danger_full_access.md");
|
||||||
@@ -502,7 +502,7 @@ impl DeveloperInstructions {
|
|||||||
let text = if approvals_reviewer == ApprovalsReviewer::GuardianSubagent
|
let text = if approvals_reviewer == ApprovalsReviewer::GuardianSubagent
|
||||||
&& approval_policy != AskForApproval::Never
|
&& approval_policy != AskForApproval::Never
|
||||||
{
|
{
|
||||||
format!("{text}\n\n{GUARDIAN_SUBAGENT_APPROVAL_SUFFIX}")
|
format!("{text}\n\n{AUTO_REVIEW_APPROVAL_SUFFIX}")
|
||||||
} else {
|
} else {
|
||||||
text
|
text
|
||||||
};
|
};
|
||||||
@@ -1944,7 +1944,8 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.into_text();
|
.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"));
|
assert!(text.contains("materially safer alternative"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1959,6 +1960,7 @@ mod tests {
|
|||||||
)
|
)
|
||||||
.into_text();
|
.into_text();
|
||||||
|
|
||||||
|
assert!(!text.contains("`approvals_reviewer` is `auto_review`"));
|
||||||
assert!(!text.contains("`approvals_reviewer` is `guardian_subagent`"));
|
assert!(!text.contains("`approvals_reviewer` is `guardian_subagent`"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user