Skip to content

fix(coding-agent): send a supported codex client_version in model discovery - #831

Closed
MingTeer wants to merge 2 commits into
PrimeIntellect-ai:mainfrom
MingTeer:fix/702-codex-client-version
Closed

fix(coding-agent): send a supported codex client_version in model discovery#831
MingTeer wants to merge 2 commits into
PrimeIntellect-ai:mainfrom
MingTeer:fix/702-codex-client-version

Conversation

@MingTeer

@MingTeer MingTeer commented Aug 7, 2026

Copy link
Copy Markdown

Summary

ModelRegistry.getExecutableModels() passed the prime-agent package version as client_version when discovering ChatGPT codex models. The backend gates the catalog by codex CLI version, so 0.7.0 read as an ancient client and returned {"models": []}, hiding every openai-codex/* model from find_models and rlm() subagent spawns, which then failed with the misleading "unavailable, unauthenticated, or expired" error.

Changes

  • Send a pinned, known-good codex CLI version (OPENAI_CODEX_CLIENT_VERSION = "0.146.1") as client_version instead of the prime-agent package version, with a comment noting the floor must be bumped if the catalog ever comes back empty.
  • Treat an empty catalog as a discovery failure instead of caching it as a valid result for 5 minutes, so a later non-empty response can recover within the same session.
  • Add regression tests covering both behaviors (test/suite/regressions/702-codex-client-version.test.ts).

Verification

  • New regression tests pass (2/2), adjacent 4649-subagent-model-selection suite passes (12/12)
  • npm run check clean
  • Reproduced end-to-end on macOS arm64: with the fix, openai-codex/* models appear in find_models and subagent spawns succeed with a valid OAuth credential

Fixes #702

Note

Fix OpenAI Codex model discovery to send a supported client_version

  • Replaces the prime-agent package VERSION with a hardcoded Codex CLI version ("0.146.1") in the client_version query parameter of openAICodexModelsUrl, since the backend gates access by Codex CLI version.
  • Treats an empty model catalog (200 response with models: []) as a discovery failure rather than caching it as a successful empty result, causing callers to fall back to excluding Codex models until a non-empty discovery succeeds.
  • Adds regression tests in 702-codex-client-version.test.ts covering both fixes.

Macroscope summarized c9d1377.

…covery

Model discovery against the ChatGPT codex backend passed the prime-agent
package version as client_version; the backend gates the catalog by codex
CLI version and returned an empty catalog, hiding all openai-codex models
from find_models and rlm subagents. An empty catalog is now treated as a
discovery failure instead of being cached as a valid result.

fixes PrimeIntellect-ai#702
@ProDrifterDK

Copy link
Copy Markdown

Validated this fix independently against current main (a18809e0) by reapplying it in ProDrifterDK/prime-agent@a2f910e3.

Environment:

  • Prime Agent source: 0.7.1
  • Pop!_OS 24.04 LTS, kernel 7.0.11-76070011-generic, x86_64
  • OpenAI Codex subscription OAuth

Evidence:

  • client_version=0.7.1 returned HTTP 200 with models: [].
  • client_version=0.146.1 returned 9 models, including gpt-5.6-sol and gpt-5.6-luna.
  • The issue-specific regression passed: 2/2 tests.
  • The Codex discovery and subagent-selection regressions passed together: 14/14 tests.
  • npm run check passed.
  • An isolated live smoke test on a separate daemon socket succeeded: a Codex Sol parent discovered openai-codex/gpt-5.6-luna, admitted a Luna RLM child, and received SMOKE LUNA MESSAGE OK through agent_message.

This confirms both the catalog fix and the real Sol-to-Luna RLM path without modifying the globally installed runtime.

…t-version

# Conflicts:
#	packages/coding-agent/CHANGELOG.md
@sethkarten

Copy link
Copy Markdown
Contributor

Thank you for the report and proposed work. This root cause is now covered by maintainer-owned stacked PR #1164, authored independently from upstream/main.

We did not inspect or reuse this PR's diff, branch, commits, implementation code, or tests; its public description/comments were used only as a bug report. To keep one review surface, this PR is superseded by #1164 and is being closed.

The complete review stack is #1158#1165. It is being left unmerged for human review after CI and review-bot findings are cleared.

@sethkarten sethkarten closed this Aug 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

openai-codex models invisible to rlm subagents: model discovery sends prime-agent VERSION as codex client_version, backend returns empty catalog

3 participants