mirror of
https://github.com/openai/codex.git
synced 2026-11-19 22:30:42 +00:00
Remove the legacy sandbox policy constructor (#59772)
## What changed Remove `FileSystemSandboxContext::from_legacy_sandbox_policy` and migrate its test callers to `from_permission_profile`. Construct read-only, disabled, and externally enforced sandbox contexts directly with `PermissionProfile`. GitOrigin-RevId: e330b89d060061eda106232eab554be5ccd06149
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use super::*;
|
||||
use crate::discover_v2::capability_locations::tests::request;
|
||||
use crate::discover_v2::capability_locations::tests::write;
|
||||
use codex_protocol::protocol::SandboxPolicy;
|
||||
use codex_protocol::models::PermissionProfile;
|
||||
use codex_utils_path_uri::PathUri;
|
||||
use pretty_assertions::assert_eq;
|
||||
|
||||
@@ -69,10 +69,10 @@ async fn discovery_responses_are_cached_by_sandbox_context() -> anyhow::Result<(
|
||||
for index in 0..MAX_CACHED_SANDBOX_CONTEXTS {
|
||||
let sandbox_cwd = cwd.join(&format!("context-{index}"))?;
|
||||
let sandbox = DiscoverV2CapabilitiesRequest {
|
||||
sandbox: Some(FileSystemSandboxContext::from_legacy_sandbox_policy(
|
||||
SandboxPolicy::DangerFullAccess,
|
||||
sandbox: Some(FileSystemSandboxContext::from_permission_profile(
|
||||
PermissionProfile::Disabled,
|
||||
sandbox_cwd,
|
||||
)?),
|
||||
)),
|
||||
..params.clone()
|
||||
};
|
||||
let response = manager.get_or_refresh_discovery(sandbox.clone()).await?;
|
||||
|
||||
@@ -136,10 +136,10 @@ async fn watch_events_invalidate_discovery_and_no_subscription_disables_caching(
|
||||
.any(|skill| skill.path == demo_skill && skill.description == "ready")
|
||||
);
|
||||
let sandbox_params = DiscoverV2CapabilitiesRequest {
|
||||
sandbox: Some(crate::FileSystemSandboxContext::from_legacy_sandbox_policy(
|
||||
codex_protocol::protocol::SandboxPolicy::DangerFullAccess,
|
||||
sandbox: Some(crate::FileSystemSandboxContext::from_permission_profile(
|
||||
codex_protocol::models::PermissionProfile::Disabled,
|
||||
params.cwd.clone(),
|
||||
)?),
|
||||
)),
|
||||
..params.clone()
|
||||
};
|
||||
manager.get_or_refresh_discovery(sandbox_params).await?;
|
||||
|
||||
Reference in New Issue
Block a user