mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Honor per-environment shell variable policies (#38902)
## What changed - Carry `ShellEnvironmentPolicy` in each resolved `EnvironmentConfig` and use the selected turn environment's policy for shell commands, user shell tasks, and unified exec. - Infer the policy from the thread configuration when an environment does not provide its own resolved configuration. - Redact the policy from `EnvironmentConfig` debug output because it can contain explicit environment variable values. ## Testing - Verify shell handlers and unified exec filter inherited variables according to the selected environment while preserving its explicit overrides. GitOrigin-RevId: 9f6a52aa4af60e5f17251a0e1b11e1926b779055
This commit is contained in:
1 parent
f85e81d30b
commit
6c108912ee
22 files changed
+219
-52
No files matched your search
@@ -81,12 +81,7 @@ async fn run_exec_like(args: RunExecLikeArgs) -> Result<FunctionToolOutput, Func
|
||||
|
||||
let fs = turn_environment.environment.get_filesystem();
|
||||
|
||||
let mut explicit_env_overrides = turn
|
||||
.config
|
||||
.permissions
|
||||
.shell_environment_policy
|
||||
.r#set
|
||||
.clone();
|
||||
let mut explicit_env_overrides = turn_environment.shell_environment_policy().r#set.clone();
|
||||
let mut env = exec_params.env.clone();
|
||||
strip_output_env(&mut env);
|
||||
strip_output_env(&mut explicit_env_overrides);
|
||||
|
||||
Reference in new issue
Block a user