mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Support catalog messages for non-request approval policies (#34434)
## What changed - Add model-catalog approval message variants for `never` and `unless_trusted`. - Select the catalog message that matches the active approval policy, while retaining the existing built-in text when that variant is absent. - Treat an explicitly empty variant as an instruction to suppress the built-in approval text, consistent with `on_request` messages. ## Testing - Cover variant selection, fallback and empty-message behavior, catalog deserialization, and the initial permissions message sent to the model. GitOrigin-RevId: a0f8d41a08645f39b80093be53f200eeee18ca25
This commit is contained in:
@@ -515,6 +515,8 @@ pub struct ModelMessages {
|
||||
pub struct ApprovalMessages {
|
||||
pub on_request: Option<String>,
|
||||
pub on_request_auto_review: Option<String>,
|
||||
pub never: Option<String>,
|
||||
pub unless_trusted: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize, Clone, PartialEq, Eq, TS, JsonSchema)]
|
||||
@@ -765,7 +767,8 @@ mod tests {
|
||||
"instructions_template": null,
|
||||
"instructions_variables": null,
|
||||
"approvals": {
|
||||
"on_request": ""
|
||||
"on_request": "",
|
||||
"never": ""
|
||||
}
|
||||
}"#,
|
||||
)
|
||||
@@ -776,6 +779,8 @@ mod tests {
|
||||
Some(ApprovalMessages {
|
||||
on_request: Some(String::new()),
|
||||
on_request_auto_review: None,
|
||||
never: Some(String::new()),
|
||||
unless_trusted: None,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user