mirror of
https://github.com/openai/codex.git
synced 2026-10-20 17:38:45 +00:00
Support catalog templates for approved command prefixes (#55366)
## What changed
Add `approved_prefixes` to catalog permission messages, with `{{ approved_prefixes }}` substitution for the approved command list. An empty template suppresses the section; missing or null values retain the bundled template.
For `on-request` approvals, append an explicitly supplied prefix template even when the catalog also supplies approval instructions. Use the template for bundled `on-request` and granular approval instructions as well.
## Testing
Extend the remote model catalog integration test to cover custom prefix rendering alongside catalog approval instructions and suppression with an empty template.
GitOrigin-RevId: 82dd6f83caa56cab0a2f6343bf912efe2cb97d64
This commit is contained in:
@@ -784,6 +784,10 @@ pub struct PermissionMessages {
|
||||
pub danger_full_access: Option<String>,
|
||||
pub workspace_write: Option<String>,
|
||||
pub read_only: Option<String>,
|
||||
/// Supports `{{ approved_prefixes }}`. Missing or null uses the bundled text;
|
||||
/// an empty string suppresses the approved-prefix section.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub approved_prefixes: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Default, Serialize, Deserialize, Clone, PartialEq, Eq, TS, JsonSchema)]
|
||||
@@ -1310,6 +1314,7 @@ mod tests {
|
||||
danger_full_access: None,
|
||||
workspace_write: Some(String::new()),
|
||||
read_only: None,
|
||||
approved_prefixes: None,
|
||||
})
|
||||
);
|
||||
}
|
||||
@@ -1554,6 +1559,7 @@ mod tests {
|
||||
danger_full_access: None,
|
||||
workspace_write: Some("workspace".to_string()),
|
||||
read_only: None,
|
||||
approved_prefixes: None,
|
||||
}),
|
||||
multi_agent: None,
|
||||
token_budget: None,
|
||||
|
||||
Reference in New Issue
Block a user