Skip to content

codex: the CLI install is the one pre-agent installer not on the shared retry window #909

Description

@tend-agent

install-claude-binary.sh and install-proxy-uv.sh both retry their CDN fetch on the shared window in shared/steps/lib/retry.sh (#906, #907, #908). The Codex harness has a third pre-agent installer that isn't on it: codex/action.yaml:120-124 runs npm install -g "@openai/codex@${{ inputs.codex_version }}" bare — one attempt, no timeout, no backoff.

The failure mode is the one the shared window exists for. The step runs ahead of Run Codex, so an npm registry blip costs the whole run: the job goes red having done none of the work the trigger asked for, exactly as a CDN blip on claude.ai did before #906. Five steps sit ahead of the agent in that action (security preflight, rate-limit preflight, auth validation, the CLI install, plugin install, AGENTS.md staging), and this is the only one that reaches out to a third-party registry.

Proposed fix

retry_install can't be called from where the install currently lives — it's an inline run: block, and the lib is only reachable from a script under shared/steps/. So the change is an extraction first, matching what install-proxy-uv.sh already does:

# shared/steps/install-codex-cli.sh
set -euo pipefail
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
# shellcheck source=lib/retry.sh
. "${SCRIPT_DIR}/lib/retry.sh"

retry_install "codex ${CODEX_VERSION}" "npm install -g '@openai/codex@${CODEX_VERSION}'"
codex --version

with the action step becoming a run: bash "${{ github.action_path }}/../shared/steps/install-codex-cli.sh" plus env: CODEX_VERSION: ${{ inputs.codex_version }}.

One thing to settle first

retry_install hardcodes timeout 60, which suits a curl | sh that fetches a single installer script. A global npm install resolves and unpacks a dependency tree, and I haven't measured how long @openai/codex takes on a cold runner — if it can legitimately exceed 60s, dropping it under the current lib would convert slow installs into failures rather than riding out blips. Whoever picks this up should time the install on a runner and either confirm 60s is generous or add an optional third parameter (retry_install LABEL COMMAND [TIMEOUT], defaulting to 60) before wiring codex in.

Raised in the review of #908, where the shared lib lands.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions