A self-improving RLM agent for coding workflows and long-running autonomous tasks.
Rust
bump the Codex client version claimed by ChatGPT model discovery (gpt-6-sol/luna gate, discussion #2544) (#3146)
kt8de3580bffa7
diff --git a/packages/coding-agent/.changes/codex-discovery-client-version.md b/packages/coding-agent/.changes/codex-discovery-client-version.mdnew file mode 100644index 0000000000..35c0c37f52--- /dev/null+++ b/packages/coding-agent/.changes/codex-discovery-client-version.md@@ -0,0 +1 @@+- Fixed Codex subscription model discovery to claim the current stable Codex CLI release (0.159.0, up from 0.153.4): ChatGPT gates the discovery endpoint on `client_version`, and the stale pin hid GPT-6 Sol and Luna from `rlm` subagent delegation and `find_models()` while the `/model` picker kept offering them ([#2544](https://github.com/PrimeIntellect-ai/prime-agent/discussions/2544)).diff --git a/packages/coding-agent/src/core/model-registry.ts b/packages/coding-agent/src/core/model-registry.tsindex 14ba7ab2f9..05b9964fd0 100644--- a/packages/coding-agent/src/core/model-registry.ts+++ b/packages/coding-agent/src/core/model-registry.ts@@ -379,20 +379,19 @@ function readOpenAICodexAccountId(token: string): string | undefined {* than an error. Prime Agent's own package version is far below the Codex CLI's version line, so it must* report a supported Codex client version here instead.*- * Shipping a new Codex model takes two edits, and both are required:- * 1. Add the model to `codexModels` in `packages/ai/scripts/generate-models.ts` and regenerate. That list is- * explicit, not fetched, so an unlisted model does not exist for Prime Agent at all.- * 2. Raise this constant to a Codex CLI release whose catalog includes that model. `getExecutableModels()`- * below intersects the registry with the discovered catalog, so a listed model the catalog omits is- * dropped.+ * Model rows ship from the prime-agent-catalog repo through the live provider catalog fetch, so shipping+ * a new Codex subscription model needs no client-side model data. It still needs this constant raised to a+ * Codex CLI release whose catalog includes that model: `getExecutableModels()` below intersects the+ * registry with the discovered catalog, so a catalog model the backend omits is dropped.*- * Skipping step 2 fails silently and asymmetrically: `rlm` subagent delegation and `find_models()` resolve- * through `getExecutableModels()` and lose the model, while `/model` reads the unfiltered `getAvailable()`- * and keeps offering it.+ * A stale constant fails silently and asymmetrically: `rlm` subagent delegation and `find_models()`+ * resolve through `getExecutableModels()` and lose the model, while `/model` reads the unfiltered+ * `getAvailable()` and keeps offering it.*- * Catalog behaviour measured 2026-08-13; see #702.+ * Catalog behaviour measured 2026-08-13 (#702: 0.153.x lists GPT-6 Astra) and 2026-09-24 (#2544: 0.155.x+ * and up also lists GPT-6 Sol and Luna); the constant tracks the current stable Codex CLI release.*/-const OPENAI_CODEX_CLIENT_VERSION = "0.153.4";+const OPENAI_CODEX_CLIENT_VERSION = "0.159.0";function openAICodexModelsUrl(baseUrl: string): string {const normalized = baseUrl.replace(/\/+$/, "");diff --git a/packages/coding-agent/test/model-registry.test.ts b/packages/coding-agent/test/model-registry.test.tsindex 80e517afc1..1b8c19a117 100644--- a/packages/coding-agent/test/model-registry.test.ts+++ b/packages/coding-agent/test/model-registry.test.ts@@ -1289,8 +1289,9 @@ describe("issue #702 codex model discovery client version", () => {// would pass today and break silently once the package version reaches the pinned constant.expect(clientVersion).toMatch(/^\d+\.\d+\.\d+$/);const [major, minor] = (clientVersion ?? "0.0.0").split(".").map(Number);- // 0.153.x is the floor at which ChatGPT discovery lists GPT-6 Astra (discussion #2062).- expect((major ?? 0) > 0 || (minor ?? 0) >= 153).toBe(true);+ // 0.155.x is the floor at which ChatGPT discovery also lists GPT-6 Sol and Luna (discussion+ // #2544); 0.153.x only listed GPT-6 Astra (discussion #2062).+ expect((major ?? 0) > 0 || (minor ?? 0) >= 155).toBe(true);expect(executable.some((model) => model.provider === "openai-codex")).toBe(true);});});