Skip to content

Commit a2b9f46

Browse files
[exec] Fix exec sandbox arg (openai#2034)
## Summary From codex-cli 😁 `-s/--sandbox` now correctly affects sandbox mode. What changed - In `codex-rs/exec/src/cli.rs`: - Added `value_enum` to the `--sandbox` flag so Clap parses enum values into ` SandboxModeCliArg`. - This ensures values like `-s read-only`, `-s workspace-write`, and `-s dange r-full-access` are recognized and propagated. Why this fixes it - The enum already derives `ValueEnum`, but without `#[arg(value_enum)]` Clap ma y not map the string into the enum, leaving the option ineffective at runtime. W ith `value_enum`, `sandbox_mode` is parsed and then converted to `SandboxMode` i n `run_main`, which feeds into `ConfigOverrides` and ultimately into the effecti ve `sandbox_policy`.
1 parent 408c7ca commit a2b9f46

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

codex-rs/exec/src/cli.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ pub struct Cli {
1919

2020
/// Select the sandbox policy to use when executing model-generated shell
2121
/// commands.
22-
#[arg(long = "sandbox", short = 's')]
22+
#[arg(long = "sandbox", short = 's', value_enum)]
2323
pub sandbox_mode: Option<codex_common::SandboxModeCliArg>,
2424

2525
/// Configuration profile from config.toml to specify default options.

0 commit comments

Comments
 (0)