Skip to content

[Bug]: Outdated Codex CLI shows "probe failed: exited with code 1" instead of the compatibility warning #20351

Closed as not planned

Description

@laterNaT

Before submitting

  • I searched existing issues and did not find a duplicate.
  • I included enough detail to reproduce or investigate the problem.

Area

apps/server

Steps to reproduce

  1. Have an old Codex CLI first on PATH. Mine is codex 0.1.4161006, the original npm @openai/codex, installed under an old nvm Node prefix.
  2. Start T3 Code (vp run dev on main) with the Codex provider enabled (the default).
  3. Open Settings → Providers, or a new thread.

Expected behavior

The model manifest already marks Codex <0.149.0 as broken and recommends >=0.159.0. T3 Code should detect the installed version and show that advisory ("known to be incompatible… Use >=0.159.0"), ideally with the Update now action.

This used to work. #404 added a minimum Codex version check that fixed #360. codexCliVersion.ts and that check were removed in the effect-codex-app-server rewrite (#1942).

Actual behavior

The Codex provider shows only:

Codex app-server provider probe failed: Codex App Server process exited with code 1.

Nothing says the CLI is outdated. The old CLI treats app-server as a prompt, prints "Missing OpenAI API key." and exits 1.

The cause seems to be in checkCodexProviderStatus (apps/server/src/provider/CodexProvider.ts). The only source of the Codex version is the userAgent in the app-server initialize response. A CLI that can't complete that handshake gets version: null in all three failure branches (spawn error, non-zero exit, timeout). Both features that would explain the problem are then skipped:

  • applyProviderCompatibility (apps/server/src/provider/providerCompatibility.ts) resolves status unknown for a null version, so the manifest's broken range never applies.
  • enrichProviderSnapshotWithVersionAdvisory (packages/provider-core/src/server/maintenanceResolver.ts) only looks up the latest version when snapshot.version is set, so no update is offered.

Impact

Minor bug or occasional failure

Version or commit

main @ e58a485

Environment

macOS 26.6.2, Node 24.22.0, dev server (vp run dev), codex 0.1.4161006 resolved from PATH.

Logs or stack traces

$ codex --version
0.1.4161006
$ codex app-server </dev/null; echo "exit: $?"

Missing OpenAI API key.

Set the environment variable OPENAI_API_KEY and re-run this command.
exit: 1

Workaround

Update or remove the old CLI so a current codex is first on PATH, or set Settings → Providers → Codex → Binary path to a current executable. Disabling the Codex provider also hides the error.

Possible fix (happy to send a PR if this direction is OK)

When the app-server probe fails without a spawn error, run codex --version and set its version in the failed snapshot. The fix would be server-only. The client already handles this case: getProviderStatusMessage in apps/web/src/components/chat/ProviderStatusBanner.tsx shows a broken advisory's message ahead of status.message, even when the status is error. With a version set, the existing compatibility and update-advisory code would show "known to be incompatible with this T3 Code release. Use >=0.159.0." and offer the update.

This only affects CLIs that fail the handshake. Versions that answer initialize already get their version and advisory. A broken install whose --version also fails would still show the generic message, which seems fine.

Activity

  1. juliusmarminge commented on Oct 16, 2026

    @juliusmarminge
    Member

    Note

    Grok responding on behalf of Julius.

    Confirmed on main. In checkCodexProviderStatus (apps/server/src/provider/CodexProvider.ts), the only version source is the initialize userAgent. The probe-failure and timeout branches both return version: null. So applyProviderCompatibility resolves unknown and enrichProviderSnapshotWithVersionAdvisory skips the update lookup, and a CLI too old to speak app-server only gets the generic "probe failed … exited with code 1" message.

    Until there's a fix, the workaround is to put a current codex first on PATH, or set Settings → Providers → Codex → Binary path to a current executable.

    The direction you proposed is in scope, and a PR is welcome. Keep it server-only: when the probe fails and it isn't a spawn error, run codex --version with a short timeout and put the parsed version on the failed snapshot so the existing compatibility and update advisory code runs. If --version also fails, keep today's message. Please include a test for the non-zero-exit branch.

  2. added
    bugSomething is broken or behaving incorrectly.
    via-triageFiled through npx t3 triage
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken or behaving incorrectly.via-triageFiled through npx t3 triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions