mirror of
https://github.com/openai/codex.git
synced 2026-11-27 23:31:09 +00:00
Preserve attachment Unix socket grants when controller policy is omitted (#46004)
## Why An omitted controller socket policy was treated as an explicit denial, preventing execution environments from supplying their own Unix socket grants. ## What changed - Preserve omission of `dangerously_allow_all_unix_sockets` separately from `false`, and retain explicitly empty `unix_sockets` maps. - Defer to attachment socket permissions when the controller supplies neither setting. Continue enforcing explicit restrictions, socket denials, and managed requirements. - Resolve omitted values to `false` for ordinary execution and remote configuration, preserving the default for commands without attachment grants. - Add debug logging for effective environment and remote execution network policies. ## Testing Add regression coverage for omitted, explicit, finite, empty, and managed socket policies through remote launch configuration, including live policy replacement and serialization round trips. Adjust remote environment tests to tolerate child-completion ordering and box large cold-resume test futures to reduce Windows stack usage. GitOrigin-RevId: 98a88d01cbb91aea1faaa03b3c414ef3be7af398
This commit is contained in:
1 parent
3c6f32ca82
commit
43354d0f61
15 files changed
+258
-51
No files matched your search
@@ -1787,7 +1787,8 @@ async fn overview_cold_resume_honors_working_directory_selection() -> Result<()>
|
||||
("session", true, true),
|
||||
("session", false, false),
|
||||
] {
|
||||
let mut app = make_test_app().await;
|
||||
// Keep the large setup and cold-resume futures off the Windows test stack.
|
||||
let mut app = Box::pin(make_test_app()).await;
|
||||
trust_fixture_folders(&mut app);
|
||||
let chosen = app.config.codex_home.join("chosen");
|
||||
let overridden = app.config.codex_home.join("overridden");
|
||||
@@ -1814,7 +1815,8 @@ async fn overview_cold_resume_honors_working_directory_selection() -> Result<()>
|
||||
)
|
||||
.expect("create historical session"),
|
||||
)?;
|
||||
let mut app_server = crate::start_embedded_app_server_for_picker(&app.config).await?;
|
||||
let mut app_server =
|
||||
Box::pin(crate::start_embedded_app_server_for_picker(&app.config)).await?;
|
||||
app.launch_cwd = chosen.to_path_buf();
|
||||
app.harness_overrides.cwd = cli_cwd.then(|| {
|
||||
if runtime_cwd {
|
||||
@@ -1838,8 +1840,7 @@ async fn overview_cold_resume_honors_working_directory_selection() -> Result<()>
|
||||
drop(selection);
|
||||
let pending_loading =
|
||||
crate::custom_terminal::test_support::last_rendered_buffer(&tui.terminal).clone();
|
||||
app.select_agents_overview_thread(&mut tui, &mut app_server, thread_id)
|
||||
.await?;
|
||||
Box::pin(app.select_agents_overview_thread(&mut tui, &mut app_server, thread_id)).await?;
|
||||
// The widget replacement clears the terminal; feedback must remain until the next draw.
|
||||
let loading =
|
||||
crate::custom_terminal::test_support::last_rendered_buffer(&tui.terminal).clone();
|
||||
@@ -1858,21 +1859,19 @@ async fn overview_cold_resume_honors_working_directory_selection() -> Result<()>
|
||||
insta::allow_duplicates! {
|
||||
insta::assert_snapshot!(loading_text.trim_end(), @"Loading task…");
|
||||
}
|
||||
app.handle_tui_event(&mut tui, &mut app_server, TuiEvent::Draw)
|
||||
.await?;
|
||||
Box::pin(app.handle_tui_event(&mut tui, &mut app_server, TuiEvent::Draw)).await?;
|
||||
assert_ne!(
|
||||
crate::custom_terminal::test_support::last_rendered_buffer(&tui.terminal),
|
||||
&loading,
|
||||
);
|
||||
let observed = app_server
|
||||
.resume_thread(
|
||||
&app.local_settings,
|
||||
app.config.clone(),
|
||||
thread_id,
|
||||
crate::app_server_session::ResumeModelSettings::PreserveExistingThread,
|
||||
)
|
||||
.await?
|
||||
.session;
|
||||
let observed = Box::pin(app_server.resume_thread(
|
||||
&app.local_settings,
|
||||
app.config.clone(),
|
||||
thread_id,
|
||||
crate::app_server_session::ResumeModelSettings::PreserveExistingThread,
|
||||
))
|
||||
.await?
|
||||
.session;
|
||||
assert_eq!(
|
||||
(app.config.cwd.clone(), observed.cwd),
|
||||
(expected_cwd.clone(), expected_cwd),
|
||||
|
||||
Reference in new issue
Block a user