mirror of
https://github.com/pchuan98/codex.git
synced 2026-07-01 00:31:56 +08:00
3d356723c4
## Why `codex-shell-escalation` exposed a `codex-core`-specific adapter layer (`ShellActionProvider`, `ShellPolicyFactory`, and `run_escalate_server`) that existed only to bridge `codex-core` to `EscalateServer`. That indirection increased API surface and obscured crate ownership without adding behavior. This change moves orchestration into `codex-core` so boundaries are clearer: `codex-shell-escalation` provides reusable escalation primitives, and `codex-core` provides shell-tool policy decisions. Admittedly, @pakrym rightfully requested this sort of cleanup as part of https://github.com/openai/codex/pull/12649, though this avoids moving all of `codex-shell-escalation` into `codex-core`. ## What changed - Made `EscalateServer` public and exported it from `shell-escalation`. - Removed the adapter layer from `shell-escalation`: - deleted `shell-escalation/src/unix/core_shell_escalation.rs` - removed exports for `ShellActionProvider`, `ShellPolicyFactory`, `EscalationPolicyFactory`, and `run_escalate_server` - Updated `core/src/tools/runtimes/shell/unix_escalation.rs` to: - create `Stopwatch`/cancellation in `codex-core` - instantiate `EscalateServer` directly - implement `EscalationPolicy` directly on `CoreShellActionProvider` Net effect: same escalation flow with fewer wrappers and a smaller public API. ## Verification - Manually reviewed the old vs. new escalation call flow to confirm timeout/cancellation behavior and approval policy decisions are preserved while removing wrapper types.
22 lines
432 B
Rust
22 lines
432 B
Rust
#[cfg(unix)]
|
|
mod unix;
|
|
|
|
#[cfg(unix)]
|
|
pub use unix::EscalateAction;
|
|
#[cfg(unix)]
|
|
pub use unix::EscalateServer;
|
|
#[cfg(unix)]
|
|
pub use unix::EscalationPolicy;
|
|
#[cfg(unix)]
|
|
pub use unix::ExecParams;
|
|
#[cfg(unix)]
|
|
pub use unix::ExecResult;
|
|
#[cfg(unix)]
|
|
pub use unix::ShellCommandExecutor;
|
|
#[cfg(unix)]
|
|
pub use unix::Stopwatch;
|
|
#[cfg(unix)]
|
|
pub use unix::main_execve_wrapper;
|
|
#[cfg(unix)]
|
|
pub use unix::run_shell_escalation_execve_wrapper;
|