fix: keep codex models executable when discovery returns an empty catalog - #717
fix: keep codex models executable when discovery returns an empty catalog#717ayushnangia wants to merge 1 commit into
Conversation
…alog fixes PrimeIntellect-ai#696 A successful discovery response with zero models is an entitlement or client-version gate (PrimeIntellect-ai#639), not proof that an authenticated provider has no models. getExecutableModels() filtered every openai-codex model on it and cached the empty set for 5 minutes, while the same credentials served completions and the error blamed authentication. Empty catalogs now fail open (fresh and cached); non-empty catalogs filter exactly as before.
|
Tested this locally against the current branch, including a real Codex/Luna subagent dispatch. The fix works as intended, and I did not observe any other breaking changes in the affected flow. |
|
Thanks for the independent verification — a real Codex/Luna subagent dispatch is exactly the flow this guards. For reference, #731 is the companion fix (correct |
|
Verified locally. I applied this PR's empty-catalog fail-open fix to my installed Prime Agent runtime and restarted the daemon. Environment:
Before the fix:
After the fix and restart:
This verifies the fix against the bundled runtime path used by the daemon, not only the unbundled module. |
|
Thanks for the before/after verification — that's the second independent confirmation on this PR (with the Codex/Luna dispatch test above), both on live runtimes. For anyone landing here from the RLM-discovery symptom: #731 is the companion that fixes discovery itself (correct |
…l+o (PrimeIntellect-ai#717) - Add expandTools to EditorAction in pi-tui so components can access it - Update bash-execution, compaction-summary-message, branch-summary-message, and tool-execution to use getEditorKeybindings().getKeys('expandTools') - Pass expandTools config to setEditorKeybindings in KeybindingsManager.create() - Style keybinding with 'dim' color, description with 'muted' (matches startup hints)
…ct-ai#724) Follow-up to PrimeIntellect-ai#717. Replaces all remaining hardcoded keybinding hints with configurable ones. - Add pasteImage to AppAction so it can be configured in keybindings.json - Create keybinding-hints.ts with reusable helper functions: - editorKey(action) / appKey(keybindings, action) - get key display string - keyHint(action, desc) / appKeyHint(kb, action, desc) / rawKeyHint(key, desc) - styled hints - Export helpers from components/index.ts for extensions - Update all components to use configured keybindings - Remove now-unused getDisplayString() from KeybindingsManager and EditorKeybindingsManager - Use keybindings.matches() instead of matchesKey() for pasteImage in custom-editor.ts
…table when discovery returns an empty catalog
|
Completely reasonable — a clean review surface built from |
Fixes #696.
Problem
getExecutableModels()treats a successful discovery response with zero models the same as a real catalog: everyopenai-codexmodel is filtered out and the empty set is cached for 5 minutes. As #696 documents, the same credentials serve completions over/codex/responses, the picker still offers the model viagetAvailable(), and the resulting subagent error blames authentication.An empty 200 is an entitlement or client-version gate (#639), not proof that an authenticated provider has no models — and #639's fix leaves this handling latent for any account whose gate returns a subset or nothing.
Change
packages/coding-agent/src/core/model-registry.ts: empty catalogs fail open — codex models stay executable and per-request errors surface the real cause. Applies to the fresh result, the fresh-cache read, and the stale-cache fallback via onefilterByCataloghelper. Non-empty catalogs filter exactly as before; the empty result is still cached, so there is no refetch-per-call.Tests
test/suite/regressions/696-empty-codex-catalog.test.ts:npm run checkclean; test run from the package root per AGENTS.md.Note
Low Risk
Narrow change to Codex executable-model filtering with fail-open behavior on empty discovery; subset filtering and auth failure paths are unchanged.
Overview
Fixes #696 by changing how
getExecutableModels()applies OpenAI Codex model discovery.Previously, a successful discovery response with zero models was treated like a real catalog: every
openai-codexentry was removed from the executable list and that empty set was cached for five minutes, while completions could still work and the UI could still show those models viagetAvailable().filterByCatalognow fails open when the discovered ID set is empty—Codex models stay executable and any entitlement or version issue surfaces on the actual request. When discovery returns one or more slugs, filtering is unchanged. The helper is used for fresh discovery, cache hits, and stale-cache fallback.Regression tests cover empty catalog, cached empty catalog (single fetch), and subset filtering.
Reviewed by Cursor Bugbot for commit e1a5579. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Fix
ModelRegistry.getExecutableModelsto keep codex models available when discovery returns an empty catalogWhen the OpenAI Codex catalog discovery returns an empty set,
getExecutableModelspreviously filtered out all codex models. The fix introduces afilterByCataloghelper in model-registry.ts that skips catalog filtering when the discovered ID set is empty, treating an empty catalog as a failed entitlement check and failing open. Non-empty catalogs still filter as before. A regression test suite in 696-empty-codex-catalog.test.ts covers the empty catalog, cached empty catalog, and non-empty catalog cases.Macroscope summarized e1a5579.