feat: introduce EffectivePermissions

This commit is contained in:
Michael Bolin
2026-02-12 14:14:15 -08:00
parent 466be55abc
commit ebf5556cab
30 changed files with 278 additions and 191 deletions
@@ -1677,11 +1677,11 @@ impl CodexMessageProcessor {
}
let cwd = params.cwd.unwrap_or_else(|| self.config.cwd.clone());
let env = create_env(&self.config.shell_environment_policy, None);
let env = create_env(&self.config.permissions.shell_environment_policy, None);
let timeout_ms = params
.timeout_ms
.and_then(|timeout_ms| u64::try_from(timeout_ms).ok());
let started_network_proxy = match self.config.network.as_ref() {
let started_network_proxy = match self.config.permissions.network.as_ref() {
Some(spec) => match spec.start_proxy().await {
Ok(started) => Some(started),
Err(err) => {
@@ -1713,7 +1713,7 @@ impl CodexMessageProcessor {
let requested_policy = params.sandbox_policy.map(|policy| policy.to_core());
let effective_policy = match requested_policy {
Some(policy) => match self.config.sandbox_policy.can_set(&policy) {
Some(policy) => match self.config.permissions.sandbox_policy.can_set(&policy) {
Ok(()) => policy,
Err(err) => {
let error = JSONRPCErrorError {
@@ -1725,7 +1725,7 @@ impl CodexMessageProcessor {
return;
}
},
None => self.config.sandbox_policy.get().clone(),
None => self.config.permissions.sandbox_policy.get().clone(),
};
let codex_linux_sandbox_exe = self.config.codex_linux_sandbox_exe.clone();