mirror of
https://github.com/openai/codex.git
synced 2026-05-21 03:33:41 +00:00
Stabilize remote full-ci test startup paths
Remote full-ci was past the project-root failures but still exposed remote-test startup assumptions. Emit failed unified-exec end events when process creation is rejected, make the network-denial tests use /bin/sh in minimal remote containers, align TurnStarted waits with the existing submit-turn completion timeout, and make the delayed realtime sideband handshake deterministic. Co-authored-by: Codex <noreply@openai.com>
This commit is contained in:
@@ -20,12 +20,15 @@ setup_remote_env() {
|
||||
local codex_binary_path
|
||||
local container_ip
|
||||
local remote_codex_path
|
||||
local remote_codex_linux_sandbox_path
|
||||
local remote_exec_server_pid
|
||||
local remote_exec_server_port
|
||||
local remote_exec_server_stdout_path
|
||||
|
||||
container_name="${CODEX_TEST_REMOTE_ENV_CONTAINER_NAME:-codex-remote-test-env-local-$(date +%s)-${RANDOM}}"
|
||||
codex_binary_path="${REPO_ROOT}/codex-rs/target/debug/codex"
|
||||
remote_codex_path="${CODEX_TEST_REMOTE_CODEX_PATH:-/tmp/codex-remote-env/codex}"
|
||||
remote_codex_linux_sandbox_path="$(dirname "${remote_codex_path}")/codex-linux-sandbox"
|
||||
|
||||
if ! command -v docker >/dev/null 2>&1; then
|
||||
echo "docker is required (Colima or Docker Desktop)" >&2
|
||||
@@ -65,12 +68,12 @@ setup_remote_env() {
|
||||
fi
|
||||
|
||||
if [[ -z "${CODEX_TEST_REMOTE_EXEC_SERVER_URL:-}" ]]; then
|
||||
remote_codex_path="/tmp/codex-remote-env/codex"
|
||||
remote_exec_server_port="31987"
|
||||
remote_exec_server_stdout_path="/tmp/codex-remote-env/exec-server.stdout"
|
||||
docker exec "${container_name}" sh -lc "mkdir -p /tmp/codex-remote-env"
|
||||
docker cp "${codex_binary_path}" "${container_name}:${remote_codex_path}"
|
||||
docker exec "${container_name}" chmod +x "${remote_codex_path}"
|
||||
docker exec "${container_name}" sh -lc \
|
||||
"chmod +x ${remote_codex_path} && ln -sf ${remote_codex_path} ${remote_codex_linux_sandbox_path}"
|
||||
remote_exec_server_pid="$(
|
||||
docker exec "${container_name}" sh -lc \
|
||||
"rm -f ${remote_exec_server_stdout_path}; nohup ${remote_codex_path} exec-server --listen ws://0.0.0.0:${remote_exec_server_port} > ${remote_exec_server_stdout_path} 2>&1 & echo \$!"
|
||||
@@ -89,6 +92,7 @@ setup_remote_env() {
|
||||
fi
|
||||
|
||||
export CODEX_TEST_REMOTE_ENV="${container_name}"
|
||||
export CODEX_TEST_REMOTE_CODEX_PATH="${remote_codex_path}"
|
||||
}
|
||||
|
||||
wait_for_remote_exec_server_port() {
|
||||
@@ -116,6 +120,7 @@ codex_remote_env_cleanup() {
|
||||
fi
|
||||
unset CODEX_TEST_REMOTE_EXEC_SERVER_PID
|
||||
unset CODEX_TEST_REMOTE_EXEC_SERVER_URL
|
||||
unset CODEX_TEST_REMOTE_CODEX_PATH
|
||||
}
|
||||
|
||||
if ! is_sourced; then
|
||||
@@ -128,6 +133,7 @@ set -euo pipefail
|
||||
if setup_remote_env; then
|
||||
status=0
|
||||
echo "CODEX_TEST_REMOTE_ENV=${CODEX_TEST_REMOTE_ENV}"
|
||||
echo "CODEX_TEST_REMOTE_CODEX_PATH=${CODEX_TEST_REMOTE_CODEX_PATH}"
|
||||
echo "CODEX_TEST_REMOTE_EXEC_SERVER_URL=${CODEX_TEST_REMOTE_EXEC_SERVER_URL}"
|
||||
echo "Remote env ready. Run your command, then call: codex_remote_env_cleanup"
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user