From d5d4801166664e21443a592976d3dfed079ca61b Mon Sep 17 00:00:00 2001 From: SaladDay <1203511142@qq.com> Date: Sun, 25 Oct 2026 04:54:16 +0000 Subject: [PATCH] Ship the Codex code-mode host in the Runtime image Native code_mode runs model-written scripts in codex-code-mode-host, which Codex 0.153.4 looks for beside its executable. The Runtime image carried only the codex executable, so programmatic tool calling on Codex failed in every Docker, microsandbox and E2B Environment. The native installer already ships the whole package. --- deploy/distribution/Runtime.Dockerfile | 2 +- docs/maintainers.md | 2 +- docs/zh/maintainers.md | 2 +- scripts/build-codex-runtime.sh | 4 ++-- services/core/deploy/codex/Dockerfile | 4 +++- services/core/deploy/codex/README.md | 6 +++--- 6 files changed, 11 insertions(+), 9 deletions(-) diff --git a/deploy/distribution/Runtime.Dockerfile b/deploy/distribution/Runtime.Dockerfile index 886bc08d5..8487bcd34 100644 --- a/deploy/distribution/Runtime.Dockerfile +++ b/deploy/distribution/Runtime.Dockerfile @@ -9,7 +9,7 @@ FROM ${MCODE_IMAGE} # Keep the shared daemon and dependencies from the MiniMax base. # Native harness packages remain outside the workspace. -COPY --from=codex /usr/local/bin/codex /usr/local/bin/codex +COPY --from=codex /usr/local/bin/codex /usr/local/bin/codex-code-mode-host /usr/local/bin/ COPY --from=codex /usr/local/codex-resources /usr/local/codex-resources COPY --from=claude /opt/claude-sdk /opt/claude-sdk diff --git a/docs/maintainers.md b/docs/maintainers.md index 4ba321ec6..d67aaa308 100644 --- a/docs/maintainers.md +++ b/docs/maintainers.md @@ -95,7 +95,7 @@ docker build --platform linux/amd64 -t oac-runtime:mcode "${OAC_DEV_HOME:-$HOME/ `scripts/prepare-release-runtimes.sh` runs the companion build from the pins. -The distribution combines the three Harness images into one Runtime image (`deploy/distribution/Runtime.Dockerfile`): the MiniMax Code image, which carries the daemon, with the Codex executable and resources and the Claude Code bundle copied in. It verifies that each image carries the daemon built from the same commit. +The distribution combines the three Harness images into one Runtime image (`deploy/distribution/Runtime.Dockerfile`): the MiniMax Code image, which carries the daemon, with the Codex executables and resources and the Claude Code bundle copied in. It verifies that each image carries the daemon built from the same commit. **E2B helper.** diff --git a/docs/zh/maintainers.md b/docs/zh/maintainers.md index 0a542a927..24908cbf9 100644 --- a/docs/zh/maintainers.md +++ b/docs/zh/maintainers.md @@ -1,7 +1,7 @@ --- title: "构建并发布 OpenAgentCore" source: docs/maintainers.md -source_hash: 4f856b71fa88a18950c6830dc906ef060ccf79f7514585606f0fdc9df94a89b5 +source_hash: 6f1b4534b4b473c47175560c24ca6e1d1fe2ff4c5e764f204d1022939e4178b3 --- 本指南面向负责构建和发布 OpenAgentCore 的维护者。要安装 Core 和 Web,请按 [安装 Core 和 Web](getting-started/install.md) 操作。安装程序代码遵循的规则见 [部署](https://github.com/MiniMax-AI/OpenAgentCore/blob/main/deploy/README.md) 和 [节点安装程序](https://github.com/MiniMax-AI/OpenAgentCore/blob/main/deploy/node/README.md);必需检查见 [CONTRIBUTING](https://github.com/MiniMax-AI/OpenAgentCore/blob/main/CONTRIBUTING.md#required-checks)。 diff --git a/scripts/build-codex-runtime.sh b/scripts/build-codex-runtime.sh index 8269cd07c..9d650269f 100755 --- a/scripts/build-codex-runtime.sh +++ b/scripts/build-codex-runtime.sh @@ -18,7 +18,7 @@ package = json.load(open(sys.argv[1])) assert package['name'] == '@openai/codex' and package['version'] == '0.153.4-linux-x64', 'Expected pinned official Linux x64 package' PY native_dir="$package_dir/vendor/x86_64-unknown-linux-musl" -for executable in "$native_dir/bin/codex"; do +for executable in "$native_dir/bin/codex" "$native_dir/bin/codex-code-mode-host"; do test -x "$executable" || { printf 'Missing executable: %s\n' "$executable" >&2; exit 1; } done test -d "$native_dir/codex-resources" @@ -30,7 +30,7 @@ trap 'rm -rf "$context"' EXIT CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -mod=readonly -trimpath \ -o "$context/oac-daemon" ./apps/daemon/cmd/oac-daemon ) -cp "$native_dir/bin/codex" "$context/codex" +cp "$native_dir/bin/codex" "$native_dir/bin/codex-code-mode-host" "$context/" cp -R "$native_dir/codex-resources" "$context/codex-resources" cp "$repo_root/services/core/deploy/codex/Dockerfile" "$context/Dockerfile" cp "$repo_root/services/core/deploy/runtime_profile.py" "$context/runtime_profile.py" diff --git a/services/core/deploy/codex/Dockerfile b/services/core/deploy/codex/Dockerfile index d84a54b22..5b798f653 100644 --- a/services/core/deploy/codex/Dockerfile +++ b/services/core/deploy/codex/Dockerfile @@ -10,7 +10,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \ && mkdir -p /environment/workspace /workspace /home/runtime COPY runtime_profile.py /tmp/oac-runtime-profile.py RUN python3 /tmp/oac-runtime-profile.py && rm /tmp/oac-runtime-profile.py -COPY --chmod=0555 oac-daemon codex /usr/local/bin/ +# Native code_mode runs model-written scripts in codex-code-mode-host, which +# Codex finds beside its executable. +COPY --chmod=0555 oac-daemon codex codex-code-mode-host /usr/local/bin/ COPY codex-resources /usr/local/codex-resources ENV HOME=/home/runtime OAC_RUNTIME_HOME=/home/runtime/.oac \ OAC_RUNTIME_CODEX_BIN=/usr/local/bin/codex \ diff --git a/services/core/deploy/codex/README.md b/services/core/deploy/codex/README.md index 16eb3f4dc..64896f3ce 100644 --- a/services/core/deploy/codex/README.md +++ b/services/core/deploy/codex/README.md @@ -62,16 +62,16 @@ Codex `0.153.4` reports a provider HTTP 400 as `other` and puts the provider's e ## Runtime image -[`Dockerfile`](Dockerfile) builds the Codex Runtime image from a prepared context that holds only `oac-daemon`, the unmodified `codex` executable and `codex-resources`. +[`Dockerfile`](Dockerfile) builds the Codex Runtime image from a prepared context that holds only `oac-daemon`, the unmodified `codex` and `codex-code-mode-host` executables and `codex-resources`. Native `code_mode` runs its scripts in `codex-code-mode-host`, which Codex finds beside its executable. | Item | Value | | --- | --- | | Base | The [shared Runtime base](../../../../docs/maintainers.md#runtime-images-and-helpers) | -| Programs | `/usr/local/bin/oac-daemon`, `/usr/local/bin/codex` (mode 0555) and `/usr/local/codex-resources` | +| Programs | `/usr/local/bin/oac-daemon`, `/usr/local/bin/codex`, `/usr/local/bin/codex-code-mode-host` (mode 0555) and `/usr/local/codex-resources` | | User | UID/GID 1000 with `HOME=/home/runtime` | | Environment | `OAC_RUNTIME_HOME=/home/runtime/.oac`, `OAC_RUNTIME_CODEX_BIN=/usr/local/bin/codex`, `OAC_RUNTIME_INITIALIZATION_DIRECTORY=/environment/initialization`, `OAC_RUNTIME_PACKAGE_DIRECTORY=/environment/packages`, `OAC_RUNTIME_STATE_DIRECTORY=/environment/runtime-state` | | Entry point | `oac-daemon connect --profile default`, working directory `/environment/workspace` | -The build fails unless `codex --version` reports the pinned version. The image holds no credentials, workspace data or product software. The distribution copies the Codex executable and resources into the combined Runtime image; see the [maintainer guide](../../../../docs/maintainers.md#runtime-images-and-helpers). +The build fails unless `codex --version` reports the pinned version. The image holds no credentials, workspace data or product software. The distribution copies the Codex executables and resources into the combined Runtime image; see the [maintainer guide](../../../../docs/maintainers.md#runtime-images-and-helpers). The [Docker adapter](../../../../docs/sandbox-provider.md#docker-adapter) owns the shared container lifecycle and isolation settings.