feat: support Codex --full-auto mode (#664)
* make codex --full-auto mode default * change codex high to auto mode
This commit is contained in:
committed by
GitHub
parent
1db2e0113e
commit
a086f82dfa
@@ -36,12 +36,12 @@
|
||||
"CODEX": {
|
||||
"DEFAULT": {
|
||||
"CODEX": {
|
||||
"sandbox": "danger-full-access"
|
||||
"sandbox": "auto"
|
||||
}
|
||||
},
|
||||
"HIGH": {
|
||||
"CODEX": {
|
||||
"sandbox": "danger-full-access",
|
||||
"sandbox": "auto",
|
||||
"model_reasoning_effort": "high"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ use crate::{
|
||||
#[serde(rename_all = "kebab-case")]
|
||||
#[strum(serialize_all = "kebab-case")]
|
||||
pub enum SandboxMode {
|
||||
Auto,
|
||||
ReadOnly,
|
||||
WorkspaceWrite,
|
||||
DangerFullAccess,
|
||||
@@ -253,9 +254,13 @@ impl Codex {
|
||||
}
|
||||
|
||||
if let Some(sandbox) = &self.sandbox {
|
||||
builder = builder.extend_params(["--sandbox", sandbox.as_ref()]);
|
||||
if sandbox == &SandboxMode::DangerFullAccess && self.approval.is_none() {
|
||||
builder = builder.extend_params(["--dangerously-bypass-approvals-and-sandbox"]);
|
||||
if sandbox == &SandboxMode::Auto {
|
||||
builder = builder.extend_params(["--full-auto"]);
|
||||
} else {
|
||||
builder = builder.extend_params(["--sandbox", sandbox.as_ref()]);
|
||||
if sandbox == &SandboxMode::DangerFullAccess && self.approval.is_none() {
|
||||
builder = builder.extend_params(["--dangerously-bypass-approvals-and-sandbox"]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"null"
|
||||
],
|
||||
"enum": [
|
||||
"auto",
|
||||
"read-only",
|
||||
"workspace-write",
|
||||
"danger-full-access",
|
||||
|
||||
@@ -154,7 +154,7 @@ export type Amp = { append_prompt: AppendPrompt, dangerously_allow_all?: boolean
|
||||
|
||||
export type Codex = { append_prompt: AppendPrompt, sandbox?: SandboxMode | null, approval?: ApprovalPolicy | null, oss?: boolean | null, model?: string | null, model_reasoning_effort?: ReasoningEffort | null, model_reasoning_summary?: ReasoningSummary | null, base_command_override?: string | null, additional_params?: Array<string> | null, };
|
||||
|
||||
export type SandboxMode = "read-only" | "workspace-write" | "danger-full-access";
|
||||
export type SandboxMode = "auto" | "read-only" | "workspace-write" | "danger-full-access";
|
||||
|
||||
export type ApprovalPolicy = "untrusted" | "on-failure" | "on-request" | "never";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user