mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Move sandbox preparation into platform backends (#62317)
## What changed Have `SandboxManager` handle backend selection and shared preparation, then delegate command wrapping and session setup to the Linux, macOS Seatbelt, Windows token, and Windows MXC backends. Centralize Windows managed proxy routing in `codex-sandboxing` so the exec server and other callers use the same rule for selecting dedicated MXC listeners. GitOrigin-RevId: a75886809aefebf6c267bb39dbc104f76bda3409
This commit is contained in:
@@ -186,6 +186,7 @@ use codex_rollout_trace::CompactionTraceContext;
|
||||
use codex_rollout_trace::ThreadStartedTraceMetadata;
|
||||
use codex_rollout_trace::ThreadTraceContext;
|
||||
use codex_sandboxing::SandboxType;
|
||||
use codex_sandboxing::managed_proxy_routing_for_windows_sandbox;
|
||||
use codex_sandboxing::policy_transforms::intersect_permission_profiles_with_context;
|
||||
use codex_shell_command::parse_command::parse_command;
|
||||
use codex_terminal_detection::user_agent;
|
||||
@@ -366,7 +367,6 @@ use crate::turn_timing::record_turn_ttfm_metric;
|
||||
use crate::unified_exec::UnifiedExecProcessManager;
|
||||
use crate::windows_sandbox::WindowsSandboxLevelExt;
|
||||
use crate::windows_sandbox::local_binding_policy_for_sandbox;
|
||||
use crate::windows_sandbox::managed_proxy_routing_for_windows_sandbox;
|
||||
use codex_core_plugins::PluginCommandAttribution;
|
||||
use codex_core_plugins::PluginsManager;
|
||||
use codex_git_utils::get_git_repo_root;
|
||||
|
||||
@@ -93,16 +93,6 @@ pub fn local_binding_policy_for_sandbox(
|
||||
}
|
||||
}
|
||||
|
||||
pub fn managed_proxy_routing_for_windows_sandbox(
|
||||
sandbox_type: SandboxType,
|
||||
) -> codex_network_proxy::ManagedProxyRouting {
|
||||
if cfg!(windows) && sandbox_type == SandboxType::WindowsMxc {
|
||||
codex_network_proxy::ManagedProxyRouting::DedicatedListeners
|
||||
} else {
|
||||
codex_network_proxy::ManagedProxyRouting::SharedIngress
|
||||
}
|
||||
}
|
||||
|
||||
/// Adapts the selected implementation for legacy checks that only understand setup levels.
|
||||
/// Backend selection must continue to use [`SandboxType`] directly.
|
||||
pub(crate) fn windows_sandbox_level_for_legacy_checks(
|
||||
|
||||
Reference in New Issue
Block a user