mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Honor per-environment login shell policy (#36811)
## What changed - Store the effective `allow_login_shell` setting on each turn environment, including inherited environments whose child thread has a different policy. - Expose the `login` argument for shell tools when any selected environment permits login shells. - Validate each command against the policy of its selected environment instead of the turn-wide configuration. ## Testing - Cover tool schema generation for single and multiple environments. - Cover login-shell rejection by both the command handler and the unified exec integration. GitOrigin-RevId: 5a93149a5c86f4087f2b92d663ebc33feff8a57c
This commit is contained in:
1 parent
61dc1d97f6
commit
b258c028fe
18 files changed
+291
-28
No files matched your search
@@ -91,14 +91,14 @@ impl ShellCommandHandler {
|
||||
turn_context: &TurnContext,
|
||||
turn_environment: &TurnEnvironment,
|
||||
cwd: AbsolutePathBuf,
|
||||
allow_login_shell: bool,
|
||||
) -> Result<ExecParams, FunctionCallError> {
|
||||
let session_shell = session.user_shell();
|
||||
let shell = turn_environment
|
||||
.shell
|
||||
.as_ref()
|
||||
.unwrap_or(session_shell.as_ref());
|
||||
let use_login_shell = Self::resolve_use_login_shell(params.login, allow_login_shell)?;
|
||||
let use_login_shell =
|
||||
Self::resolve_use_login_shell(params.login, turn_environment.config.allow_login_shell)?;
|
||||
let command = Self::base_command(shell, ¶ms.command, use_login_shell);
|
||||
|
||||
let mut env = create_env(
|
||||
@@ -214,7 +214,6 @@ impl ShellCommandHandler {
|
||||
turn.as_ref(),
|
||||
&turn_environment,
|
||||
cwd,
|
||||
turn.config.permissions.allow_login_shell,
|
||||
)?;
|
||||
let shell_type = Some(
|
||||
turn_environment
|
||||
|
||||
Reference in new issue
Block a user