diff --git a/codex-rs/cli/tests/daemon_startup.rs b/codex-rs/cli/tests/daemon_startup.rs index a78093e73a..85dea154cc 100644 --- a/codex-rs/cli/tests/daemon_startup.rs +++ b/codex-rs/cli/tests/daemon_startup.rs @@ -473,6 +473,12 @@ async fn daemon_startup(command: &str) -> Result<()> { continue; } } + // A replacement PID can appear before the TUI observes the disconnect. + // Wait for reconnect to clear/rebuild the transcript, so the old + // composer's command popup cannot make the status probe look ready. + if *input == b"/status" && !output.contains("\x1b[3J") { + continue; + } // The old header can linger while the daemon stops. Check both // the draft and its Enter against the replacement process and UI. if (*input == b"/status" || *input == b"\r") diff --git a/scripts/codex_package/smoke_tests/fixtures.py b/scripts/codex_package/smoke_tests/fixtures.py index b9e0c69b23..52e8838c46 100644 --- a/scripts/codex_package/smoke_tests/fixtures.py +++ b/scripts/codex_package/smoke_tests/fixtures.py @@ -1,6 +1,7 @@ import gzip import json import os +import platform import subprocess import tarfile from collections.abc import Iterator @@ -150,13 +151,28 @@ def package( capture_output=True, text=True, ) - return SmokePackage.from_archives( + package = SmokePackage.from_archives( directory, target, request.config.getoption("cli_archive"), request.config.getoption("app_server_archive"), compression, ) + if target == "x86_64-apple-darwin" and platform.machine() == "arm64": + # Freshly extracted Intel binaries need cold Rosetta translation before + # the command and SDK startup deadlines begin. Keep startup bounded and + # fail setup if either packaged entrypoint cannot run. + for executable in (package.cli, package.app_server): + subprocess.run( + [str(executable), "--help"], + cwd=package.directory, + env=package.environment, + check=True, + text=True, + capture_output=True, + timeout=180, + ) + return package @pytest.fixture