Skip to content

fix(catalog): omit bare OpenAI models without openai provider - #643

Merged
Wibias merged 2 commits into
lidge-jun:devfrom
Wibias:fix/636-bare-openai-catalog
Jul 29, 2026
Merged

fix(catalog): omit bare OpenAI models without openai provider#643
Wibias merged 2 commits into
lidge-jun:devfrom
Wibias:fix/636-bare-openai-catalog

Conversation

@Wibias

@Wibias Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Skip advertising bare gpt-* / native OpenAI catalog rows when no enabled canonical openai provider exists.
  • Make NoEnabledOpenAiProviderError actionable (ocx provider add openai && ocx sync && ocx restart).

Test plan

  • bun test tests/router.test.ts
  • CI green

Closes #636

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@Wibias, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 31b8deb0-2060-457b-9c67-ac51ce901810

📥 Commits

Reviewing files that changed from the base of the PR and between ca7b104 and 2a60598.

📒 Files selected for processing (3)
  • src/codex/catalog/sync.ts
  • src/router.ts
  • tests/router.test.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@Wibias

Wibias commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator Author

@codex review
@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

@Wibias: I’ll review the changes in #643, focusing on catalog filtering behavior, provider-state edge cases, error guidance, and test coverage.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@github-actions github-actions Bot added the bug Something isn't working label Jul 28, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread src/codex/catalog/sync.ts
Comment on lines +335 to +336
const native = includeNativeOpenAi
? catalogModels

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/codex/catalog/sync.ts Outdated
Comment on lines +507 to +510
const includeNativeOpenAi = Boolean(
openaiProv
&& openaiProv.disabled !== true
&& isCanonicalOpenAiForwardProvider(openaiProv),

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/codex/catalog/sync.ts
Comment on lines +335 to +336
const native = includeNativeOpenAi
? catalogModels

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Comment thread src/router.ts
Comment on lines +296 to +299
super(
`Model ${modelId} requires the canonical openai provider. `
+ `Run: ocx provider add openai && ocx sync && ocx restart`,
);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

@Wibias
Wibias merged commit f19a73c into lidge-jun:dev Jul 29, 2026
9 checks passed
Wibias added a commit that referenced this pull request Jul 29, 2026
@Wibias

Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Transition complete:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bare OpenAI models are advertised but return 404 when canonical openai provider is not configured

1 participant