From 9d253c885cb7cc48aeb749a82e31e2070e14f73e Mon Sep 17 00:00:00 2001 From: jif Date: Fri, 4 Sep 2026 11:34:12 +0000 Subject: [PATCH] Make the TUI symlink startup test Bazel-compatible (#42741) ## Why The macOS startup symlink test applies its own Seatbelt policy, which cannot run inside Bazel's sandbox. ## What changed - Tag the TUI Bazel tests with `no-sandbox` so the startup test can install its policy. - Verify that the mocked write tool reports a successful exit before checking the file written through the symlink. GitOrigin-RevId: c12eb00f995985fccc053765399fbb0eb7ce70d9 --- codex-rs/tui/BUILD.bazel | 2 ++ codex-rs/tui/tests/suite/focus_palette.rs | 9 ++++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/codex-rs/tui/BUILD.bazel b/codex-rs/tui/BUILD.bazel index 21fb44ae92..15ef18ee82 100644 --- a/codex-rs/tui/BUILD.bazel +++ b/codex-rs/tui/BUILD.bazel @@ -20,4 +20,6 @@ codex_rust_crate( test_shard_counts = { "tui-unit-tests": 8, }, + # The startup symlink test applies its own Seatbelt policy, which cannot be nested. + test_tags = ["no-sandbox"], ) diff --git a/codex-rs/tui/tests/suite/focus_palette.rs b/codex-rs/tui/tests/suite/focus_palette.rs index b06f61fb88..f9f9ff4065 100644 --- a/codex-rs/tui/tests/suite/focus_palette.rs +++ b/codex-rs/tui/tests/suite/focus_palette.rs @@ -90,7 +90,7 @@ async fn interactive_startup_honors_codex_home_symlink_opt_out() -> Result<()> { ]), ) .await; - let _completion_mock = responses::mount_sse_once_match( + let completion_mock = responses::mount_sse_once_match( &server, body_string_contains(r#"\"thread_source\":\"user\""#), responses::sse(vec![ @@ -129,6 +129,13 @@ async fn interactive_startup_honors_codex_home_symlink_opt_out() -> Result<()> { while Instant::now() < deadline { terminal.read_output(Duration::from_millis(/*millis*/ 50))?; if terminal.screen_contains("symlink-opt-out-ready") { + let tool_output = completion_mock + .function_call_output_text("write") + .context("missing symlink write tool output")?; + ensure!( + tool_output.contains("Process exited with code 0"), + "{tool_output}" + ); assert_eq!(std::fs::read(target.path().join("ready.txt"))?, b"ready"); return Ok(()); }