mirror of
https://github.com/openai/codex.git
synced 2026-10-25 15:56:38 +00:00
Resolve model-provided shells by type (#39607)
## Why A model-provided shell path should select the requested shell type without allowing that path to determine which executable Codex runs. ## What changed - Resolve model-provided shells through Codex's normal shell discovery and fallback logic after detecting their type. - Keep the configured packaged zsh executable when the zsh-fork feature is enabled and the file exists. - Update shell, unified exec, and network approval expectations to use the resolved local executable and arguments. GitOrigin-RevId: ebe6f7eec2cfd1c0548d5bf1a26b7a30dba02cc2
This commit is contained in:
@@ -1130,13 +1130,19 @@ impl Session {
|
||||
"zsh fork feature enabled, but no packaged zsh fork is available for this install"
|
||||
)
|
||||
})?;
|
||||
let zsh_path = zsh_path.to_path_buf();
|
||||
shell::get_shell(shell::ShellType::Zsh, Some(&zsh_path)).ok_or_else(|| {
|
||||
anyhow::anyhow!(
|
||||
"zsh fork feature enabled, but packaged zsh fork `{}` is not usable",
|
||||
zsh_path.display()
|
||||
)
|
||||
})?
|
||||
if zsh_path.is_file() {
|
||||
shell::Shell {
|
||||
shell_type: shell::ShellType::Zsh,
|
||||
shell_path: zsh_path.clone(),
|
||||
}
|
||||
} else {
|
||||
shell::get_shell(shell::ShellType::Zsh).ok_or_else(|| {
|
||||
anyhow::anyhow!(
|
||||
"zsh fork feature enabled, but packaged zsh fork `{}` is not usable",
|
||||
zsh_path.display()
|
||||
)
|
||||
})?
|
||||
}
|
||||
} else {
|
||||
shell::default_user_shell()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user