fix(catalog): omit bare OpenAI models without openai provider - #643
Conversation
|
Warning Review limit reached
Next review available in: 51 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
@codex review |
|
✅ Action performedReview finished.
|
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b24a29bc68
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const native = includeNativeOpenAi | ||
| ? catalogModels |
There was a problem hiding this comment.
Preserve non-OpenAI bare catalog entries
When the canonical openai provider is absent or disabled, this ternary discards the entire bare-entry collection, not just OpenAI-native rows. Consequently, a sync permanently removes user-added bare entries such as user-native, contradicting the existing preservation case in tests/codex-catalog-sync-hardening.test.ts; retain non-OpenAI bare entries while conditionally filtering only OpenAI-family natives, and add a focused regression case for the provider-absent path.
AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.
| const includeNativeOpenAi = Boolean( | ||
| openaiProv | ||
| && openaiProv.disabled !== true | ||
| && isCanonicalOpenAiForwardProvider(openaiProv), |
There was a problem hiding this comment.
Evaluate the effective OpenAI provider before hiding models
For accepted persisted configurations where providers.openai omits a registry-owned field such as authMode, this raw predicate returns false even though routedProviderConfig backfills authMode: "forward", the canonical adapter, and the canonical URL, so bare GPT requests route successfully while sync removes every corresponding picker row. This shape is already exercised by the first bare-OpenAI case in tests/router.test.ts; determine eligibility from the same registry-enriched provider used by routing, and add a sync regression test for that accepted minimal configuration.
AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.
| const native = includeNativeOpenAi | ||
| ? catalogModels |
There was a problem hiding this comment.
Keep the current routed catalog authoritative after native removal
After a successful no-OpenAI sync leaves a catalog containing only routed rows, the next loadCatalogForSync call rejects that current file because it has no native template and loads the pristine backup instead. If that next provider fetch is transiently empty, mergeCatalogEntriesForSync therefore preserves the backup's stale routed rows rather than the latest successfully discovered rows, defeating the existing empty-fetch preservation behavior and making recently added provider models disappear. Preserve the current routed catalog while sourcing only the template from backup, and cover a successful-sync-then-empty-sync sequence.
AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.
| super( | ||
| `Model ${modelId} requires the canonical openai provider. ` | ||
| + `Run: ocx provider add openai && ocx sync && ocx restart`, | ||
| ); |
There was a problem hiding this comment.
Give disabled providers a working recovery command
When the openai row exists with disabled: true, the new instruction immediately fails: handleAdd rejects an existing provider unless --force is supplied (src/cli/provider.ts:156-158), while the CLI's documented non-destructive enable operation is ocx provider edit openai --enabled on (src/cli/provider-runtime.ts:15-20,42-52). Emit the enable command for this branch instead of always recommending provider add, and cover the disabled-provider message separately from the absent-provider case.
AGENTS.md reference: AGENTS.md:L93-L95
Useful? React with 👍 / 👎.
|
Transition complete:
|
Summary
gpt-*/ native OpenAI catalog rows when no enabled canonicalopenaiprovider exists.NoEnabledOpenAiProviderErroractionable (ocx provider add openai && ocx sync && ocx restart).Test plan
bun test tests/router.test.tsCloses #636