Skip to content

[Bug] Codex runtime loops on a revoked PATH binary instead of falling back #2038

Description

@Gandy2025

Summary

On macOS, the Codex runtime can select an older global npm Codex binary whose developer certificate has been revoked, classify the resulting AMFI SIGKILL as a transient smoke-check failure, and retry session startup indefinitely instead of falling back to a healthy later candidate such as the Codex bundled with ChatGPT Desktop.

Surface Area

First Tree Client Runtime — Codex binary resolution, launch verification, and session-start retry policy.

Environment

  • affected First Tree channel: staging; the issue remained after the affected host auto-updated (the screenshot reports build suffix .959.1; the exact full version was not captured)
  • filing CLI version: 0.5.18-staging.955.1
  • runtime: codex
  • selected Codex: ~/.npm-global/bin/codex, version 0.125.0
  • healthy later candidate: ChatGPT Desktop Codex 0.146.0-alpha.3
  • operating system: macOS; AMFI reported CSSMERR_TP_CERT_REVOKED (exact macOS version on the affected host was not captured)

Reproduction

  1. On macOS, leave an older global npm Codex binary on the daemon-visible resolution path.
  2. Ensure that binary is present on disk but cannot launch because macOS rejects its revoked developer certificate.
  3. Also have a healthy Codex candidate available later in First Tree's resolution order, such as ChatGPT Desktop's bundled Codex.
  4. Start a Codex-backed First Tree agent and send a message that creates or resumes a session.
  5. Observe First Tree resolve the older global binary and run codex --version.
  6. Observe repeated provider_retry_started / provider_retry_scheduled events instead of fallback or a bounded actionable failure.

Expected Behavior

First Tree should preserve automatic retry for a one-off cold-start or host-pressure smoke-check flake, but a definitively unusable candidate must not pin the runtime indefinitely.

  • Launch-verify binary candidates in resolution order and continue to later candidates when one cannot launch.
  • If every candidate fails, bound repeated identical startup failures and surface an actionable error that identifies the selected path and recommends upgrade/replacement.
  • A healthy later candidate, including ChatGPT Desktop Codex, should be selected automatically.

Actual Behavior

First Tree selects the first existing external candidate and does not continue to later candidates after launch verification fails.

The runtime reports:

codex --version smoke check did not complete (transient host condition); will retry. Detail: `codex --version` killed by SIGKILL

SIGKILL is classified as codex_verify_transient. Session-start transient retries have no total attempt limit; after the foreground attempts, the retry delay caps at 60 seconds. The chat therefore accumulates retry events indefinitely even though the same binary is deterministically rejected by macOS on every attempt.

First Tree Context

  • Chat ID: 08893fe3-4fd6-46b9-90f2-804b7ac512ae
  • Reported by (user): gandy2025
  • Affected user: shire31
  • Agent: gandy-s-assistant

Additional Context

  • macOS validation of the selected Codex reported CSSMERR_TP_CERT_REVOKED.
  • The ChatGPT Desktop Codex on the same host launched successfully, confirming that the provider and desktop app were not generally blocked.
  • Updating the stale global @openai/codex package is the immediate workaround.
  • Related prior behavior change: fix: stop treating a flaky codex --version check as a missing binary #1329 intentionally made timeout and termination-style smoke-check failures transient to avoid false "Codex missing" errors. This report is the persistent, deterministic SIGKILL gap that remains.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions