From cfadafed9cf247ffb0d0861c957a08a7f4dbcf04 Mon Sep 17 00:00:00 2001 From: anytinz <24619961+anytinz@users.noreply.github.com> Date: Thu, 3 Sep 2026 03:12:11 +0000 Subject: [PATCH] Release codex 1.2.0 Install the bundled codex-code-mode-host helper and cover both supported and legacy release layouts. --- src/codex/README.md | 4 ++++ src/codex/devcontainer-feature.json | 2 +- src/codex/install.sh | 15 +++++++++++++++ .../pinned_version_bundled_code_mode_host.sh | 14 ++++++++++++++ test/codex/pinned_version_custom_user.sh | 1 + test/codex/scenarios.json | 8 ++++++++ test/codex/test.sh | 2 ++ 7 files changed, 45 insertions(+), 1 deletion(-) create mode 100755 test/codex/pinned_version_bundled_code_mode_host.sh diff --git a/src/codex/README.md b/src/codex/README.md index aff9478..9f6c6a0 100644 --- a/src/codex/README.md +++ b/src/codex/README.md @@ -6,6 +6,7 @@ The feature installs: - `codex` - a bundled `rg` binary that matches the upstream Codex package layout +- `codex-code-mode-host` when the release bundles it (Codex v0.143.0 and newer); older releases skip it with a notice ## Example Usage @@ -76,6 +77,9 @@ The installed tool is subject to its own license: [Codex CLI license](https://gi ## Release Notes +## 1.2.0 - 2026-09-03 +- Install `codex-code-mode-host` (Codex's code editor integration helper) when it is bundled in the release package (Codex v0.143.0 and newer); older releases remain supported and skip the helper with a notice. + ## 1.1.3 - 2026-08-01 - Declare `customizations.sliekens.initializeCommand` for composable host path pre-create; document automated and manual `initializeCommand` wiring. diff --git a/src/codex/devcontainer-feature.json b/src/codex/devcontainer-feature.json index 015c04c..7ec5e9a 100644 --- a/src/codex/devcontainer-feature.json +++ b/src/codex/devcontainer-feature.json @@ -1,7 +1,7 @@ { "id": "codex", "name": "Codex CLI", - "version": "1.1.3", + "version": "1.2.0", "description": "Installs the OpenAI `codex` CLI from the official packaged release assets and persists `~/.codex` in shared state across devcontainers.", "documentationURL": "https://github.com/sliekens/devcontainer-features/blob/main/src/codex/README.md", "licenseURL": "https://github.com/sliekens/devcontainer-features/blob/main/LICENSE", diff --git a/src/codex/install.sh b/src/codex/install.sh index d6e0168..5ef2f6c 100755 --- a/src/codex/install.sh +++ b/src/codex/install.sh @@ -145,6 +145,7 @@ main() { local codex_source="" local rg_source="" + local code_mode_host_source="" # Upstream archive layout changed in newer releases; support both layouts. if [ -f "${tmp_dir}/package/vendor/${VENDOR_TARGET}/bin/codex" ]; then @@ -159,6 +160,13 @@ main() { rg_source="${tmp_dir}/package/vendor/${VENDOR_TARGET}/path/rg" fi + # `codex-code-mode-host` is bundled next to `codex` in the packaged assets + # of newer releases (openai/codex started shipping it with v0.143.0). Older + # releases do not contain it, in which case it is skipped with a notice. + if [ -f "${tmp_dir}/package/vendor/${VENDOR_TARGET}/bin/codex-code-mode-host" ]; then + code_mode_host_source="${tmp_dir}/package/vendor/${VENDOR_TARGET}/bin/codex-code-mode-host" + fi + if [ -z "$codex_source" ] || [ -z "$rg_source" ]; then echo "Unexpected Codex archive layout for ${asset_name}." echo "Archive contents:" @@ -170,6 +178,13 @@ main() { install -m 0755 "$rg_source" "${INSTALL_DIR}/rg" install -m 0755 "$SCRIPT_DIR/on_create.sh" /usr/local/share/codex/on_create.sh + if [ -n "$code_mode_host_source" ]; then + install -m 0755 "$code_mode_host_source" "${INSTALL_DIR}/codex-code-mode-host" + echo "Installed codex-code-mode-host ${release_version}." + else + echo "codex-code-mode-host is not bundled in the ${release_tag} release assets; skipping." + fi + codex --version rg --version | head -n 1 echo "Installed Codex CLI ${release_version}." diff --git a/test/codex/pinned_version_bundled_code_mode_host.sh b/test/codex/pinned_version_bundled_code_mode_host.sh new file mode 100755 index 0000000..7fe9df7 --- /dev/null +++ b/test/codex/pinned_version_bundled_code_mode_host.sh @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +set -euo pipefail + +source dev-container-features-test-lib + +check "pinned codex version" bash -lc 'codex --version | grep -F "codex-cli 0.153.0"' +check "bundled rg" /usr/local/bin/rg --version +check "codex-code-mode-host installed" test -x /usr/local/bin/codex-code-mode-host +check "codex-code-mode-host help" bash -lc 'codex-code-mode-host --help | grep -q "Usage: codex-code-mode-host"' +check "codex state symlink" bash -lc '[ -L "$HOME/.codex" ] && [ "$(readlink "$HOME/.codex")" = "/var/lib/codex" ]' +check "codex state writable" bash -lc 'tmp="$HOME/.codex/.feature-test"; printf ok > "$tmp"; [ "$(cat /var/lib/codex/.feature-test)" = "ok" ]; rm -f "$tmp"' + +reportResults diff --git a/test/codex/pinned_version_custom_user.sh b/test/codex/pinned_version_custom_user.sh index 58c34bc..87c9880 100755 --- a/test/codex/pinned_version_custom_user.sh +++ b/test/codex/pinned_version_custom_user.sh @@ -6,6 +6,7 @@ source dev-container-features-test-lib check "pinned codex version" bash -lc 'codex --version | grep -F "codex-cli 0.114.0"' check "bundled rg" /usr/local/bin/rg --version +check "codex-code-mode-host not installed on pre-bundle release" test ! -e /usr/local/bin/codex-code-mode-host check "codex state symlink" bash -lc '[ -L "$HOME/.codex" ] && [ "$(readlink "$HOME/.codex")" = "/var/lib/codex" ]' check "codex state writable" bash -lc 'tmp="$HOME/.codex/.feature-test"; printf ok > "$tmp"; [ "$(cat /var/lib/codex/.feature-test)" = "ok" ]; rm -f "$tmp"' diff --git a/test/codex/scenarios.json b/test/codex/scenarios.json index 9f6c360..17167c3 100644 --- a/test/codex/scenarios.json +++ b/test/codex/scenarios.json @@ -13,5 +13,13 @@ } }, "remoteUser": "octocat" + }, + "pinned_version_bundled_code_mode_host": { + "image": "mcr.microsoft.com/devcontainers/base:ubuntu", + "features": { + "codex": { + "version": "0.153.0" + } + } } } diff --git a/test/codex/test.sh b/test/codex/test.sh index 8db0bdf..ae4c3d6 100755 --- a/test/codex/test.sh +++ b/test/codex/test.sh @@ -9,6 +9,8 @@ source dev-container-features-test-lib # Feature-specific tests check "codex version" codex --version check "bundled rg" /usr/local/bin/rg --version +check "codex-code-mode-host installed" test -x /usr/local/bin/codex-code-mode-host +check "codex-code-mode-host help" bash -lc 'codex-code-mode-host --help | grep -q "Usage: codex-code-mode-host"' check "codex state symlink" bash -lc '[ -L "$HOME/.codex" ] && [ "$(readlink "$HOME/.codex")" = "/var/lib/codex" ]' check "codex state writable" bash -lc 'tmp="$HOME/.codex/.feature-test"; printf ok > "$tmp"; [ "$(cat /var/lib/codex/.feature-test)" = "ok" ]; rm -f "$tmp"'