@@ -9,7 +9,6 @@ use std::time::Instant;
99
1010use anyhow:: Context ;
1111use anyhow:: Result ;
12- use codex_config:: Constrained ;
1312use codex_config:: types:: McpServerConfig ;
1413use codex_config:: types:: McpServerTransportConfig ;
1514use codex_core:: sandboxing:: SandboxPermissions ;
@@ -21,7 +20,6 @@ use codex_protocol::permissions::FileSystemSandboxEntry;
2120use codex_protocol:: permissions:: FileSystemSandboxPolicy ;
2221use codex_protocol:: permissions:: NetworkSandboxPolicy ;
2322use codex_protocol:: protocol:: AskForApproval ;
24- use codex_protocol:: protocol:: SandboxPolicy ;
2523use codex_protocol:: protocol:: TurnEnvironmentSelection ;
2624use core_test_support:: assert_regex_match;
2725use core_test_support:: responses:: ev_assistant_message;
@@ -547,14 +545,9 @@ async fn shell_enforces_glob_deny_read_policy() -> Result<()> {
547545 skip_if_sandbox ! ( Ok ( ( ) ) ) ;
548546
549547 let server = start_mock_server ( ) . await ;
550- let read_only_policy = SandboxPolicy :: new_read_only_policy ( ) ;
551- let read_only_policy_for_config = read_only_policy. clone ( ) ;
552548 let mut builder = test_codex ( )
553549 . with_model ( "gpt-5.4" )
554550 . with_config ( move |config| {
555- config
556- . set_legacy_sandbox_policy ( read_only_policy_for_config)
557- . expect ( "set sandbox policy" ) ;
558551 let mut file_system_sandbox_policy = FileSystemSandboxPolicy :: default ( ) ;
559552 file_system_sandbox_policy
560553 . entries
@@ -564,11 +557,13 @@ async fn shell_enforces_glob_deny_read_policy() -> Result<()> {
564557 } ,
565558 access : FileSystemAccessMode :: None ,
566559 } ) ;
567- config. permissions . permission_profile =
568- Constrained :: allow_any ( PermissionProfile :: from_runtime_permissions (
560+ config
561+ . permissions
562+ . set_permission_profile ( PermissionProfile :: from_runtime_permissions (
569563 & file_system_sandbox_policy,
570564 NetworkSandboxPolicy :: Restricted ,
571- ) ) ;
565+ ) )
566+ . expect ( "set permission profile" ) ;
572567 } ) ;
573568 let fixture = builder. build ( & server) . await ?;
574569
@@ -608,8 +603,9 @@ async fn shell_enforces_glob_deny_read_policy() -> Result<()> {
608603 ] ;
609604 let mock = mount_sse_sequence ( & server, responses) . await ;
610605
606+ let permission_profile = fixture. session_configured . permission_profile . clone ( ) ;
611607 fixture
612- . submit_turn_with_policy ( "read the fixture files" , read_only_policy )
608+ . submit_turn_with_permission_profile ( "read the fixture files" , permission_profile )
613609 . await ?;
614610
615611 let output_text = mock
0 commit comments