mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Defer legacy filesystem policy projection (#39813)
## Why Applying session settings rebuilt and compared a legacy filesystem policy even when the update could not trigger cwd-based policy rebinding. ## What changed Compute the legacy projection only for cwd changes whose filesystem policy has a rebindable project-root write entry. Preserve the existing equivalence check before rederiving the policy. GitOrigin-RevId: c428a5c54f1b5b1300be406cac374a6fd29bb9a8
This commit is contained in:
1 parent
969efa5470
commit
67b2c8c6fb
1 file changed
+8
-9
@@ -361,14 +361,6 @@ impl SessionConfiguration {
|
|||||||
let current_file_system_sandbox_policy =
|
let current_file_system_sandbox_policy =
|
||||||
self.file_system_sandbox_policy(current_environments);
|
self.file_system_sandbox_policy(current_environments);
|
||||||
let current_network_sandbox_policy = self.network_sandbox_policy();
|
let current_network_sandbox_policy = self.network_sandbox_policy();
|
||||||
let legacy_file_system_projection =
|
|
||||||
FileSystemSandboxPolicy::from_legacy_sandbox_policy_preserving_deny_entries(
|
|
||||||
¤t_sandbox_policy,
|
|
||||||
self.cwd(),
|
|
||||||
¤t_file_system_sandbox_policy,
|
|
||||||
);
|
|
||||||
let file_system_policy_matches_legacy = current_file_system_sandbox_policy
|
|
||||||
.is_semantically_equivalent_to(&legacy_file_system_projection, self.cwd());
|
|
||||||
let file_system_policy_has_rebindable_project_root_write =
|
let file_system_policy_has_rebindable_project_root_write =
|
||||||
current_file_system_sandbox_policy
|
current_file_system_sandbox_policy
|
||||||
.entries
|
.entries
|
||||||
@@ -503,8 +495,15 @@ impl SessionConfiguration {
|
|||||||
),
|
),
|
||||||
)?;
|
)?;
|
||||||
} else if cwd_changed
|
} else if cwd_changed
|
||||||
&& file_system_policy_matches_legacy
|
|
||||||
&& file_system_policy_has_rebindable_project_root_write
|
&& file_system_policy_has_rebindable_project_root_write
|
||||||
|
&& current_file_system_sandbox_policy.is_semantically_equivalent_to(
|
||||||
|
&FileSystemSandboxPolicy::from_legacy_sandbox_policy_preserving_deny_entries(
|
||||||
|
¤t_sandbox_policy,
|
||||||
|
self.cwd(),
|
||||||
|
¤t_file_system_sandbox_policy,
|
||||||
|
),
|
||||||
|
self.cwd(),
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// Preserve richer split policies across cwd-only updates; only
|
// Preserve richer split policies across cwd-only updates; only
|
||||||
// rederive when the session is already using a structurally
|
// rederive when the session is already using a structurally
|
||||||
|
|||||||
Reference in new issue
Block a user