Repository navigation
feat(codex): load native GPT models from providers.openai.models - #5645
Conversation
A bare gpt-* id listed under providers.openai.models on the canonical Codex forward provider now becomes a native model without a code change, the way a Claude id under providers.anthropic.models already does. It borrows GPT-6 Sol's pinned row under a name generated from the slug (gpt-6-nova -> GPT-6-Nova), takes the GPT-6 272,000 default / 872,000 opt-in context pair, and is never account-gated. Built-in, retired and reserve ids never register; removing the id unregisters it. The built-in GPT-6 rows now share the same NATIVE_GPT6_CONTEXT constant. refreshConfigDerivedRegistries replaces the direct refreshUserCostOverlays calls so load, persist and reconcile all register the configured set. Plan and audit: devlog/_plan/260923_configured_native_gpt_models/.
|
Warning Review limit reachedNext included review available in 9 minutes. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: lidge-jun/opencodex/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (18)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 2c2d7d45f1
ℹ️ 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".
| } | ||
| for (const id of next) { | ||
| configuredNativeSlugs.add(id); | ||
| SUPPORTED_NATIVE_OPENAI_SLUGS.add(id); |
There was a problem hiding this comment.
Make configured-model validation cold-start stable
When a configured native is active, adding it to this process-global set also makes modelAutoCompactTokenLimitsConfigError accept that ID during a warm provider PATCH. The resulting config is persisted, but on the next cold start configSchema.safeParse runs before refreshConfigDerivedRegistries, so the set contains only built-ins and rejects the same budget; because providers.openai is not salvageable, loadConfig falls back to the default configuration. Validate these keys against the candidate config's providers.openai.models rather than registry state so a configuration accepted at runtime remains loadable after restart.
AGENTS.md reference: src/AGENTS.md:L7-L11
Useful? React with 👍 / 👎.
|
✅ Deterministic PR hygiene checks passed. |
…ge-jun#5645) A bare gpt-* id listed under providers.openai.models on the canonical Codex forward provider now becomes a native model without a code change, the way a Claude id under providers.anthropic.models already does. It borrows GPT-6 Sol's pinned row under a name generated from the slug (gpt-6-nova -> GPT-6-Nova), takes the GPT-6 272,000 default / 872,000 opt-in context pair, and is never account-gated. Built-in, retired and reserve ids never register; removing the id unregisters it. The built-in GPT-6 rows now share the same NATIVE_GPT6_CONTEXT constant. refreshConfigDerivedRegistries replaces the direct refreshUserCostOverlays calls so load, persist and reconcile all register the configured set. Plan and audit: devlog/_plan/260923_configured_native_gpt_models/.
Summary
A new native GPT model on the ChatGPT/Codex login currently needs a release: every native slug is hard-coded in
native-models.ts, andproviders.openai.modelsis ignored for the forward provider. Adding GPT-6 Sol and Luna took #5580. Claude already works from config: a new id underproviders.anthropic.modelsjust loads.This makes GPT work the same way. A bare
gpt-*id listed underproviders.openai.modelson the canonical Codex forward provider becomes a native model:gpt-6-novaappears as GPT-6-Nova in the Codex catalog,/v1/models, dashboard native rows and every pool selector, with GPT-6 Sol's ladder, modalities, instructions and speed tiers.modelContextWindows/providerContextCapslevers. The built-in GPT-6 rows now share the sameNATIVE_GPT6_CONTEXTconstant instead of four repeated literals.gpt-reserveids never register, and removing the id unregisters it; the next canonical write drops the row.gpt-*already takes the native-family route.How it works:
native-models.ts(import-free, since the GUI bundles it) owns the configured set and editsNATIVE_OPENAI_MODELS/SUPPORTED_NATIVE_OPENAI_SLUGSin place.metadata.tssubscribes and keeps its pinned-capability, upstream-entry and context tables in step. The newsrc/config/derived-registries.tsrefreshConfigDerivedRegistriesreplaces the directrefreshUserCostOverlayscalls, covering load, persist, reconcile and the provider management routes, so every process that loads config sees the same set.Known limits: a combo
nativeAliascannot target a configured id, because schema validation runs before registration. Configured ids also stay out of the entitlement-preference and main-drain sentinel sets, where they behave likegpt-5.5.Plan and audit:
devlog/_plan/260923_configured_native_gpt_models/.Verification
bun run typecheck: pass.tests/codex-integration/configured-native-models.test.ts(6 tests) covers eligibility, registration/unregistration, the inherited ladder and name, the 272K default and 872K opt-in with the max-input clamp, dashboard rows, the backfill policy, every pool selector, and built-ins unchanged.bun run structure:check: pass.git diff --check: clean.bun run test:changedresolves to most of the suite becausesrc/config.tschanged. It was still running locally when this PR opened, so full coverage is left to hosted CI on this head.Checklist