Remove the patched zsh shell execution backend (#52160)

## What changed

- Use the standard shell executor and remove the zsh fork escalation runtime, `codex-execve-wrapper`, and `shell-escalation` crate.
- Ignore `shell_zsh_fork` and `unified_exec_zsh_fork`, emit migration notices for legacy configuration, and warn when ignoring managed requirements for these flags.
- Keep the active session's `apply_patch` alias directory readable under restricted filesystem permissions.

## Testing

Add coverage for legacy configuration startup and shell execution, migration notice rendering, active alias directory selection, and nested `apply_patch` execution while other files in `CODEX_HOME` remain unreadable.

GitOrigin-RevId: 43af461fea32b4980550ee7237effd2bc0646ed8
This commit is contained in:
jif
2026-10-08 16:19:09 +00:00
committed by copyberry
parent 9b738582b1
commit cd85a26cae
105 changed files with 475 additions and 9020 deletions
+19 -8
View File
@@ -148,13 +148,9 @@ pub enum Feature {
UnifiedExec,
/// Allow unified exec commands to allocate an interactive terminal.
UnifiedExecTty,
/// Route shell tool execution through the zsh exec bridge.
/// Removed compatibility flag for the retired patched zsh backend.
ShellZshFork,
/// Allow unified exec to compose with the zsh exec bridge.
///
/// This flag is only a composition gate. Enabling it by itself must not turn
/// on either `unified_exec` or `shell_zsh_fork` because those features have
/// separate rollout and enterprise controls.
/// Removed compatibility flag for the retired patched zsh backend.
UnifiedExecZshFork,
/// Removed compatibility flag. Transcript scrollback reflow on terminal resize is always on.
TerminalResizeReflow,
@@ -639,6 +635,17 @@ impl Features {
Feature::WebSearchCached,
);
}
"shell_zsh_fork" => {
self.record_legacy_usage_force("shell_zsh_fork", Feature::ShellZshFork);
continue;
}
"unified_exec_zsh_fork" => {
self.record_legacy_usage_force(
"unified_exec_zsh_fork",
Feature::UnifiedExecZshFork,
);
continue;
}
"transcript_v2" => {
self.record_legacy_usage_force("features.transcript_v2", Feature::TranscriptV2);
continue;
@@ -754,6 +761,10 @@ impl Features {
fn legacy_usage_notice(alias: &str, feature: Feature) -> (String, Option<String>) {
let canonical = feature.key();
match feature {
Feature::ShellZshFork | Feature::UnifiedExecZshFork => (
format!("`[features].{canonical}` is deprecated and ignored."),
Some(format!("The patched zsh backend has been removed. Shell commands now use the standard shell executor. Remove `{canonical}` from [features] in config.toml or profile configuration files.")),
),
Feature::GuardianThreadContext => (
"`[features.guardianv2].thread_context` is deprecated and ignored.".to_string(),
Some("Thread-owned Guardian context is always enabled. Remove `thread_context` from [features.guardianv2] in config.toml, including profile overrides.".to_string()),
@@ -1048,14 +1059,14 @@ pub const FEATURES: &[FeatureSpec] = &[
FeatureSpec {
id: Feature::ShellZshFork,
key: "shell_zsh_fork",
stage: Stage::UnderDevelopment,
stage: Stage::Removed,
default_enabled: false,
},
FeatureSpec {
id: Feature::UnifiedExecZshFork,
key: "unified_exec_zsh_fork",
stage: Stage::Removed,
default_enabled: true,
default_enabled: false,
},
FeatureSpec {
id: Feature::ShellSnapshot,