chore: rename AskForApproval::UnlessAllowListed to AskForApproval::UnlessTrusted (#1385)

We could just rename to `Untrusted` instead of `UnlessTrusted`, but I
think `AskForApproval::UnlessTrusted` reads a bit better.
This commit is contained in:
Michael Bolin
2025-06-25 12:26:13 -07:00
committed by GitHub
parent e09691337d
commit 72082164c1
5 changed files with 5 additions and 5 deletions

View File

@@ -26,7 +26,7 @@ pub enum ApprovalModeCliArg {
impl From<ApprovalModeCliArg> for AskForApproval { impl From<ApprovalModeCliArg> for AskForApproval {
fn from(value: ApprovalModeCliArg) -> Self { fn from(value: ApprovalModeCliArg) -> Self {
match value { match value {
ApprovalModeCliArg::Untrusted => AskForApproval::UnlessAllowListed, ApprovalModeCliArg::Untrusted => AskForApproval::UnlessTrusted,
ApprovalModeCliArg::OnFailure => AskForApproval::OnFailure, ApprovalModeCliArg::OnFailure => AskForApproval::OnFailure,
ApprovalModeCliArg::Never => AskForApproval::Never, ApprovalModeCliArg::Never => AskForApproval::Never,
} }

View File

@@ -731,7 +731,7 @@ disable_response_storage = true
model: "gpt-3.5-turbo".to_string(), model: "gpt-3.5-turbo".to_string(),
model_provider_id: "openai-chat-completions".to_string(), model_provider_id: "openai-chat-completions".to_string(),
model_provider: fixture.openai_chat_completions_provider.clone(), model_provider: fixture.openai_chat_completions_provider.clone(),
approval_policy: AskForApproval::UnlessAllowListed, approval_policy: AskForApproval::UnlessTrusted,
sandbox_policy: SandboxPolicy::new_read_only_policy(), sandbox_policy: SandboxPolicy::new_read_only_policy(),
shell_environment_policy: ShellEnvironmentPolicy::default(), shell_environment_policy: ShellEnvironmentPolicy::default(),
disable_response_storage: false, disable_response_storage: false,

View File

@@ -120,7 +120,7 @@ pub enum AskForApproval {
/// Everything else will ask the user to approve. /// Everything else will ask the user to approve.
#[default] #[default]
#[serde(rename = "untrusted")] #[serde(rename = "untrusted")]
UnlessAllowListed, UnlessTrusted,
/// *All* commands are autoapproved, but they are expected to run inside a /// *All* commands are autoapproved, but they are expected to run inside a
/// sandbox where network access is disabled and writes are confined to a /// sandbox where network access is disabled and writes are confined to a

View File

@@ -36,7 +36,7 @@ pub fn assess_patch_safety(
} }
// TODO(ragona): I'm not sure this is actually correct? I believe in this case // TODO(ragona): I'm not sure this is actually correct? I believe in this case
// we want to continue to the writable paths check before asking the user. // we want to continue to the writable paths check before asking the user.
AskForApproval::UnlessAllowListed => { AskForApproval::UnlessTrusted => {
return SafetyCheck::AskUser; return SafetyCheck::AskUser;
} }
} }

View File

@@ -55,7 +55,7 @@ pub(crate) enum CodexToolCallApprovalPolicy {
impl From<CodexToolCallApprovalPolicy> for AskForApproval { impl From<CodexToolCallApprovalPolicy> for AskForApproval {
fn from(value: CodexToolCallApprovalPolicy) -> Self { fn from(value: CodexToolCallApprovalPolicy) -> Self {
match value { match value {
CodexToolCallApprovalPolicy::Untrusted => AskForApproval::UnlessAllowListed, CodexToolCallApprovalPolicy::Untrusted => AskForApproval::UnlessTrusted,
CodexToolCallApprovalPolicy::OnFailure => AskForApproval::OnFailure, CodexToolCallApprovalPolicy::OnFailure => AskForApproval::OnFailure,
CodexToolCallApprovalPolicy::Never => AskForApproval::Never, CodexToolCallApprovalPolicy::Never => AskForApproval::Never,
} }