core-agent-ide/codex-rs/app-server/src
Owen Lin edacbf7b6e
feat(core): zsh exec bridge (#12052)
zsh fork PR stack:
- https://github.com/openai/codex/pull/12051 
- https://github.com/openai/codex/pull/12052 👈 

### Summary
This PR introduces a feature-gated native shell runtime path that routes
shell execution through a patched zsh exec bridge, removing MCP-specific
behavior from the shell hot path while preserving existing
CommandExecution lifecycle semantics.

When shell_zsh_fork is enabled, shell commands run via patched zsh with
per-`execve` interception through EXEC_WRAPPER. Core receives wrapper
IPC requests over a Unix socket, applies existing approval policy, and
returns allow/deny before the subcommand executes.

### What’s included
**1) New zsh exec bridge runtime in core**
- Wrapper-mode entrypoint (maybe_run_zsh_exec_wrapper_mode) for
EXEC_WRAPPER invocations.
- Per-execution Unix-socket IPC handling for wrapper requests/responses.
- Approval callback integration using existing core approval
orchestration.
- Streaming stdout/stderr deltas to existing command output event
pipeline.
- Error handling for malformed IPC, denial/abort, and execution
failures.

**2) Session lifecycle integration**
SessionServices now owns a `ZshExecBridge`.
Session startup initializes bridge state; shutdown tears it down
cleanly.

**3) Shell runtime routing (feature-gated)**
When `shell_zsh_fork` is enabled:
- Build execution env/spec as usual.
- Add wrapper socket env wiring.
- Execute via `zsh_exec_bridge.execute_shell_request(...)` instead of
the regular shell path.
- Non-zsh-fork behavior remains unchanged.

**4) Config + feature wiring**
- Added `Feature::ShellZshFork` (under development).
- Added config support for `zsh_path` (optional absolute path to patched
zsh):
- `Config`, `ConfigToml`, `ConfigProfile`, overrides, and schema.
- Session startup validates that `zsh_path` exists/usable when zsh-fork
is enabled.
- Added startup test for missing `zsh_path` failure mode.

**5) Seatbelt/sandbox updates for wrapper IPC**
- Extended seatbelt policy generation to optionally allow outbound
connection to explicitly permitted Unix sockets.
- Wired sandboxing path to pass wrapper socket path through to seatbelt
policy generation.
- Added/updated seatbelt tests for explicit socket allow rule and
argument emission.

**6) Runtime entrypoint hooks**
- This allows the same binary to act as the zsh wrapper subprocess when
invoked via `EXEC_WRAPPER`.

**7) Tool selection behavior**
- ToolsConfig now prefers ShellCommand type when shell_zsh_fork is
enabled.
- Added test coverage for precedence with unified-exec enabled.
2026-02-17 20:19:53 -08:00
..
bespoke_event_handling.rs feat(core): plumb distinct approval ids for command approvals (#12051) 2026-02-18 01:55:57 +00:00
codex_message_processor.rs app-server: Emit thread archive/unarchive notifications (#12030) 2026-02-17 14:53:58 -08:00
config_api.rs feat(core): add network constraints schema to requirements.toml (#10958) 2026-02-07 19:48:24 +00:00
dynamic_tools.rs fix(app-server): surface more helpful errors for json-rpc (#11638) 2026-02-13 00:14:55 +00:00
error_code.rs Reapply "Add app-server transport layer with websocket support" (#11370) 2026-02-11 18:13:39 +00:00
filters.rs [app-server] feat: add filtering on thread list (#9897) 2026-01-26 21:54:19 +00:00
fuzzy_file_search.rs [app-server] add fuzzyFileSearch/sessionCompleted (#11773) 2026-02-13 15:08:14 -08:00
lib.rs app-server: thread resume subscriptions (#11474) 2026-02-11 16:21:13 -08:00
main.rs feat(core): zsh exec bridge (#12052) 2026-02-17 20:19:53 -08:00
message_processor.rs fix(app-server): surface more helpful errors for json-rpc (#11638) 2026-02-13 00:14:55 +00:00
models.rs chore: rm remote models fflag (#11699) 2026-02-17 11:43:16 -08:00
outgoing_message.rs Feat: add model reroute notification (#12001) 2026-02-17 11:02:23 -08:00
thread_state.rs feat(core): plumb distinct approval ids for command approvals (#12051) 2026-02-18 01:55:57 +00:00
transport.rs app-server: thread resume subscriptions (#11474) 2026-02-11 16:21:13 -08:00