Skip to content

fix(catalog): carry bare-OpenAI catalog omit onto dig2-go (#643) - #681

Merged
Wibias merged 1 commit into
lidge-jun:dev2-gofrom
Wibias:maintainer-carry/643-bare-openai-catalog
Jul 29, 2026
Merged

fix(catalog): carry bare-OpenAI catalog omit onto dig2-go (#643)#681
Wibias merged 1 commit into
lidge-jun:dev2-gofrom
Wibias:maintainer-carry/643-bare-openai-catalog

Conversation

@Wibias

@Wibias Wibias commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

Go port

Deferred: #680

Go has catalog_sync.go / visibility; needs omit-native-without-openai + actionable error parity.

Test plan

  • Cherry-pick clean

…jun#643)

Fixes lidge-jun#636. Skip bare gpt-*/native OpenAI catalog rows when no enabled canonical openai provider exists; make NoEnabledOpenAiProviderError actionable.
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (2)
  • ^dev$
  • ^preview$

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 5aef66c6-7959-4352-b545-df978a84abad

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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

@Wibias
Wibias merged commit 6a24af0 into lidge-jun:dev2-go Jul 29, 2026
7 of 10 checks passed
@github-actions github-actions Bot added the bug Something isn't working label Jul 29, 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: 02fe25fe74

ℹ️ 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
// #636: when the user only configured non-OpenAI providers (e.g. kimi), do not advertise
// bare gpt-* rows that hard-404 via NoEnabledOpenAiProviderError. Keep natives when no
// providers are configured yet (fresh install / catalog bootstrap tests).
const includeNativeOpenAi = enabledProviders.length === 0 || hasCanonicalOpenai;

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 Omit native models when all providers are disabled

When every configured provider is disabled—especially an existing canonical openai row—enabledProviders is empty, so this condition sets includeNativeOpenAi to true and sync preserves/backfills bare GPT models. Those entries remain selectable even though routeModel rejects them because openai.disabled === true; distinguish a genuinely empty provider configuration from a configuration with zero enabled providers, and add a focused disabled-OpenAI sync regression.

AGENTS.md reference: AGENTS.md:L112-L114

Useful? React with 👍 / 👎.

Comment thread src/router.ts
super(`No enabled OpenAI provider for model: ${modelId}. Run 'ocx init' to configure a provider, or check that your config has an enabled 'openai' provider.`);
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 Provide a working recovery command for disabled OpenAI

When the canonical openai provider exists but is disabled, this error recommends ocx provider add openai, but handleAdd in src/cli/provider.ts:163-165 exits with Provider "openai" already exists unless --force is supplied. The supported non-destructive recovery shown by the provider CLI is ocx provider edit openai --enabled on, so the error needs to distinguish disabled from missing providers rather than directing affected users to a command that immediately fails.

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.

P1 Badge Preserve user-added bare catalog entries

For any configuration with enabled providers but no canonical openai, setting includeNativeOpenAi to false makes this ternary discard every bare catalog row, not just the supported OpenAI-native slugs. That deletes user-added entries such as user-native, whose preservation is an explicit existing invariant in tests/codex-catalog-sync-hardening.test.ts:57-90 and tests/codex-catalog-restore.test.ts:41-62; because sync overwrites the catalog, additions made after the pristine backup can be lost. Keep non-OpenAI bare rows and conditionally filter/backfill only the native OpenAI slug set.

Useful? React with 👍 / 👎.

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.

1 participant