chore: rename unless-allow-listed to untrusted (#1378)
For the `approval_policy` config option, renames `unless-allow-listed` to `untrusted`. In general, when it comes to exec'ing commands, I think "trusted" is a more accurate term than "safe." Also drops the `AskForApproval::AutoEdit` variant, as we were not really making use of it, anyway. Fixes https://github.com/openai/codex/issues/1250. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/1378). * #1379 * __->__ #1378
This commit is contained in:
@@ -47,8 +47,7 @@ pub(crate) struct CodexToolCallParam {
|
||||
#[derive(Debug, Clone, Deserialize, JsonSchema)]
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
pub(crate) enum CodexToolCallApprovalPolicy {
|
||||
AutoEdit,
|
||||
UnlessAllowListed,
|
||||
Untrusted,
|
||||
OnFailure,
|
||||
Never,
|
||||
}
|
||||
@@ -56,8 +55,7 @@ pub(crate) enum CodexToolCallApprovalPolicy {
|
||||
impl From<CodexToolCallApprovalPolicy> for AskForApproval {
|
||||
fn from(value: CodexToolCallApprovalPolicy) -> Self {
|
||||
match value {
|
||||
CodexToolCallApprovalPolicy::AutoEdit => AskForApproval::AutoEdit,
|
||||
CodexToolCallApprovalPolicy::UnlessAllowListed => AskForApproval::UnlessAllowListed,
|
||||
CodexToolCallApprovalPolicy::Untrusted => AskForApproval::UnlessAllowListed,
|
||||
CodexToolCallApprovalPolicy::OnFailure => AskForApproval::OnFailure,
|
||||
CodexToolCallApprovalPolicy::Never => AskForApproval::Never,
|
||||
}
|
||||
@@ -164,8 +162,7 @@ mod tests {
|
||||
"approval-policy": {
|
||||
"description": "Execution approval policy expressed as the kebab-case variant name (`unless-allow-listed`, `auto-edit`, `on-failure`, `never`).",
|
||||
"enum": [
|
||||
"auto-edit",
|
||||
"unless-allow-listed",
|
||||
"untrusted",
|
||||
"on-failure",
|
||||
"never"
|
||||
],
|
||||
|
||||
Reference in New Issue
Block a user