Repository navigation
Description
Client or integration
Codex App
Area
Catalog / models
Summary
OpenCodex discovers new native OpenAI models successfully, but the upstream model-picker priority is overwritten with the same large fallback rank assigned to older unfeatured native models whenever subagentModels contains featured models. The new entry is therefore buried in the Codex model picker despite being enabled and present in the live proxy catalog. The same behavior persists with no modelPickerOrder configured.
Expected: Automatically discovered native models retain their upstream ordering relative to other unfeatured models, while explicitly featured/subagent choices remain ahead of them. New model IDs must appear and sort correctly without adding ID-specific constants, hardcoded name lists, manual catalog pins, or a per-release modelPickerOrder update.
Reproduction
Observed on 2026-10-27 KST:
- Run OpenCodex 2.92.0 with an enabled native
openaiprovider and four entries insubagentModels. - Make sure no custom picker order is configured:
ocx models order reset; verifyocx models order statusreportsSaved mode: default. ConfirmmodelPickerOrderandmodelPickerOrderModeare absent from the persisted configuration. - Refresh the provider's model catalog with
ocx sync. - Inspect the new native model descriptor in
~/.opencodex/discovered-native-models.json. The observedgpt-6.1-terradescriptor hasrow.priority: 3. - Inspect the published
~/.codex/opencodex-catalog.jsonand~/.codex/models_cache.json:gpt-6.1-terrahaspriority: 104in both, withvisibility: list. - Query the live OpenCodex
/v1/modelsendpoint: the model is present. Repeatocx sync: the rank remains 104. - Open the Codex App model picker, refreshing stale app-server processes separately when necessary. The priority-sorted picker has the new native model in the generic late band.
Likely cause: src/codex/catalog/build-entries.ts in mergeCatalogEntriesFromObservedState:
const nativePriority = (slug: string, fallback: unknown): number => {
const base = baseline.get(slug)
?? (typeof fallback === "number" ? fallback : 9);
if (rank.has(slug)) return rank.get(slug)!;
return featured.length > 0 ? Math.max(base, featured.length + 100) : base;
};With featured.length === 4, an upstream native priority of 3 becomes 104. Several unrelated native models collapse to the same band, losing their meaningful source ordering. A one-off modelPickerOrder listing the new ID moves it to the front but is not an acceptable general solution.
Regression / acceptance criteria
- Dynamically preserve source order/priority metadata for non-featured native models, using stable generic fallback behavior when the upstream field is absent; never require model-specific registration to fix rank.
- Preserve explicit operator selections: featured subagent models remain preferred. Do not regress
spawn_agent's model eligibility and supported-choice contract; if appropriate, separate display priority from spawn priority. - Do not hardcode
gpt-6.1-terraor any future model ID in ranking logic, static lists, generated pins, or default config. - Keep live
/v1/models, published Codex catalog, and model cache consistent. Report stale Codex app-server state distinctly from ranking correctness. - Add regression tests for synthetic unknown native IDs (with and without upstream priority), existing native models, four featured models, no custom order, repeated sync, and upstream reorder.
Related issues: #6257 (automatic native discovery design), #3630 (periodic catalog refresh), #1046 (stale app-server), and #7366 (spawn_agent unfeatured fill). This bug is specifically about ranking after successful model discovery.
Version
@bitkyc08/opencodex 2.92.0.
Operating system
macOS on Apple Silicon (OS release number not captured during reproduction).
Provider and model
Native OpenAI / gpt-6.1-terra (example exposing the general problem; the expected fix must be model-agnostic).
Logs or error output
No model-fetch or publication error. All the relevant calls complete successfully. Observed values:
ocx models order status: Saved mode: default
discovered-native-models.json: gpt-6.1-terra -> row.priority: 3
opencodex-catalog.json: gpt-6.1-terra -> priority: 104, visibility: list
models_cache.json: gpt-6.1-terra -> priority: 104, visibility: list
GET /v1/models: gpt-6.1-terra present
Screenshots and supporting files
Reproduction details and source function above; no screenshots or private logs attached.
Redacted configuration
Illustrative minimal shape only; all credentials, account identifiers, and host-specific paths omitted:
{
"providers": {
"openai": { "adapter": "openai-responses", "codexAccountMode": "pool" }
},
"subagentModels": ["<featured-native-A>", "<featured-native-B>", "<featured-native-C>", "<featured-routed-D>"]
}modelPickerOrder and modelPickerOrderMode are not defined.
Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Activity
github-actions commentedon Oct 26, 2026
Issue reopened
The report now contains the information required by the automated check. Thanks for updating it.
fix(codex): preserve native source priority behind featured subagent …
lidge-jun commentedon Oct 28, 2026
Fixed by #7839, merged to dev as 338bcf5. With featured subagent models, unfeatured native models now publish featured.length + 100 + their upstream source priority (current discovered descriptor, then the pristine catalog backup, then the retained per-model value, then the upstream snapshot, then 9), so new models keep their upstream order behind the featured block. The live Codex /v1/models list, the published catalog and models_cache use the same resolver, repeated syncs do not compound, and no model id is hardcoded. An already-running Codex app-server may need its usual refresh to pick up the new catalog.