mirror of
https://github.com/openai/codex.git
synced 2026-11-02 19:43:24 +00:00
## What changed Use `windowsSandbox/setupStart` for elevated and unelevated setup, and handle completion notifications while retaining the pending approval preset and permission profile selection. Verify the effective sandbox mode before enabling Agent mode. Keep input locked and setup pending when the start request times out or its response is lost. Block thread replacement during setup, ignore completion notifications for a different mode, and clear interrupted setup state with a restart message after reconnection. Preserve the fallback prompt when elevated setup fails and report unelevated setup failures. Remove the TUI's direct sandbox setup helpers and sandbox-mode configuration writes. ## Testing Add regression coverage for uncertain setup responses, matching completion modes, blocked thread replacement with retained input, and interrupted setup during reconnection. GitOrigin-RevId: 5ec1101a1a69b3f96f01fc2ba6a03112705f4918
21 lines
848 B
Rust
21 lines
848 B
Rust
//! Windows sandbox display state derived from configuration.
|
|
|
|
use crate::legacy_core::config::Config;
|
|
use codex_config::types::WindowsSandboxModeToml;
|
|
use codex_features::Feature;
|
|
use codex_protocol::config_types::WindowsSandboxLevel;
|
|
|
|
pub(crate) fn level_from_config(config: &Config) -> WindowsSandboxLevel {
|
|
match config.permissions.windows_sandbox_mode {
|
|
Some(WindowsSandboxModeToml::Elevated) => WindowsSandboxLevel::Elevated,
|
|
Some(WindowsSandboxModeToml::Unelevated) => WindowsSandboxLevel::RestrictedToken,
|
|
None if config.features.enabled(Feature::WindowsSandboxElevated) => {
|
|
WindowsSandboxLevel::Elevated
|
|
}
|
|
None if config.features.enabled(Feature::WindowsSandbox) => {
|
|
WindowsSandboxLevel::RestrictedToken
|
|
}
|
|
None => WindowsSandboxLevel::Disabled,
|
|
}
|
|
}
|