Skip to content

[Bug]: A non-Codex binary in Codex "Binary path" reports an opaque decode-wire-message probe failure and adopts its --version #40696

Open

Description

@seankoji

Note

Written by DeepSeek V4.1 Flash on behalf of @seankoji

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. Put a non-Codex CLI at the Codex binary path. A shell wrapper is enough: it prints noop v1.2.3 for --version and its multi-line help text (to stdout) for app-server.
  2. Set it in T3 Code → Settings → Providers → Codex → Binary path (or providerInstances.codex.config.binaryPath in settings.json).
  3. Open Settings → Providers, or call the server's provider capabilities.

Expected behavior

The Codex provider should say the configured binary is not Codex and name the path (or at least say it did not speak the app-server protocol), so the misconfiguration is obvious.

Actual behavior

Codex keeps its cached model list but gains this constraint:

Codex app-server provider probe failed: Codex App Server protocol operation 'decode-wire-message' failed..

The message names neither the binary nor the cause, and the version probe adopts the other CLI's version: versionAdvisory.currentVersion became 2.3.2 while latestVersion was 0.171.0, so the UI treats a non-Codex binary as an outdated-but-known Codex.

Correcting the binary path clears the constraint on the next probe with no restart, which confirms the binary was the only variable.

Why it happens

  • withCodexAppServerClient spawns <binaryPath> app-server -c thread_unload_delay_secs=0 (apps/server/src/provider/CodexProvider.ts:650, apps/server/src/provider/codexLaunchArgs.ts:16).
  • The unrelated CLI prints plain text to stdout, and decodeWireMessage parses every stdout line as JSON (packages/effect-codex-app-server/src/protocol.ts:129). Effect fails with Expected a valid JSON string, which CodexProvider.ts:1098 then wraps as Codex app-server provider probe failed: ${error.message}. — the trailing full stop is why it reads failed...
  • probeCodexCliVersion parses --version with CODEX_CLI_VERSION_PATTERN (CodexProvider.ts:149), which is (?:^|\s)v?(\d+\.\d+\.\d+...) and happily matches noop v1.2.3.

Proposed fix

  1. Use the strict shape already applied to local installs, /^codex-cli (\d+\.\d+\.\d+)$/ (apps/server/src/provider/CodexInstallation.ts:541), for the configured binary path too. When it does not match, report "not Codex" with the path instead of adopting the value.
  2. Include the binary path, and the first rejected stdout line (truncated), in the probe failure message; or map decode-wire-message failures to "the configured binary did not speak the app-server protocol".
  3. Optional: run app-server --help against the configured path first, the same pre-check CodexInstallation.ts:545 already uses.

Impact

Minor bug or occasional failure. It hides a one-field configuration mistake behind an opaque protocol error, and the wrong version is then used for compatibility and update advice.

Version or commit

0.1.12-nightly.20261122.5071, with codex-cli 0.171.0.

Environment

Linux x64 (Mint 22.3), T3 Code server 0.1.12-nightly.20261122.5071, codex-cli 0.171.0 from the standalone package.

Logs or stack traces

CodexAppServerProtocolParseError: Codex App Server protocol operation 'decode-wire-message' failed.
    at CodexAppServerProtocolParseError.fromSchemaError (t3:280662:11)
    at CodexAppServerProtocol.request.awaitResponse (t3:281081:41)
    at withCodexAppServerClient (t3:282048:24)
    at CodexSkillsProbe.probe (t3:423808:115)
    at OrchestratorMcpService.capabilities (t3:505802:50) {
  [cause]: SchemaError: Expected a valid JSON string
}

Workaround

Clear the Codex Binary path (it falls back to codex on PATH) or point it at the real Codex binary. The next probe succeeds.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions