Skip to content

feat(codex): load native GPT models from providers.openai.models - #5645

Merged
lidge-jun merged 1 commit into
devfrom
codex/configured-native-gpt-models
Sep 23, 2026
Merged

lidge-jun merged 1 commit into
devfrom
codex/configured-native-gpt-models

Conversation

@lidge-jun

Copy link
Copy Markdown
Owner

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, and providers.openai.models is ignored for the forward provider. Adding GPT-6 Sol and Luna took #5580. Claude already works from config: a new id under providers.anthropic.models just loads.

This makes GPT work the same way. A bare gpt-* id listed under providers.openai.models on the canonical Codex forward provider becomes a native model:

"openai": { "adapter": "openai-responses", "authMode": "forward",
            "baseUrl": "https://chatgpt.com/backend-api/codex", "models": ["gpt-6-nova"] }
  • gpt-6-nova appears 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.
  • Context inherits the GPT-6 pair: 272,000 default and an 872,000 opt-in ceiling through the usual modelContextWindows / providerContextCaps levers. The built-in GPT-6 rows now share the same NATIVE_GPT6_CONTEXT constant instead of four repeated literals.
  • It is never account-gated. Built-in, retired and gpt-reserve ids never register, and removing the id unregisters it; the next canonical write drops the row.
  • Routing is unchanged, because bare 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 edits NATIVE_OPENAI_MODELS / SUPPORTED_NATIVE_OPENAI_SLUGS in place. metadata.ts subscribes and keeps its pinned-capability, upstream-entry and context tables in step. The new src/config/derived-registries.ts refreshConfigDerivedRegistries replaces the direct refreshUserCostOverlays calls, covering load, persist, reconcile and the provider management routes, so every process that loads config sees the same set.

Known limits: a combo nativeAlias cannot 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 like gpt-5.5.

Plan and audit: devlog/_plan/260923_configured_native_gpt_models/.

Verification

  • bun run typecheck: pass.
  • New 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.
  • Focused set: configured-native-models, gpt6-native-rows, native-model-toggle, codex-catalog, reserve-catalog, file-size-ratchet, structure-ssot, repo-hygiene and test-layout → 501 pass / 0 fail.
  • bun run structure:check: pass. git diff --check: clean.
  • bun run test:changed resolves to most of the suite because src/config.ts changed. It was still running locally when this PR opened, so full coverage is left to hosted CI on this head.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

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/.
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner September 23, 2026 04:56
@coderabbitai

coderabbitai Bot commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 9 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: lidge-jun/opencodex/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: ef97b8c4-1508-4556-a635-2970e2ed4fcd

📥 Commits

Reviewing files that changed from the base of the PR and between 0f9254b and 2c2d7d4.

📒 Files selected for processing (18)
  • devlog/_plan/260923_configured_native_gpt_models/010_plan.md
  • devlog/_plan/260923_configured_native_gpt_models/020_audit.md
  • docs-site/src/content/docs/reference/configuration/providers.md
  • scripts/test-layout/layout.json
  • src/codex/catalog/build-entries.ts
  • src/codex/catalog/metadata.ts
  • src/codex/catalog/native-models.ts
  • src/config.ts
  • src/config/derived-registries.ts
  • src/config/live-reconcile.ts
  • src/config/load-degrade.ts
  • src/config/persist-unlocked.ts
  • src/server/management/provider-routes.ts
  • src/usage/user-cost-overlay-reconciler.ts
  • src/vision/reasoning.ts
  • structure/catalog.md
  • tests/codex-integration/configured-native-models.test.ts
  • tests/fixtures/test-layout-expected.json

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.

❤️ Share

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

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 23, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-23T05:02:35.209535Z 2c2d7d4 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@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: 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);

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

@github-actions github-actions Bot added the enhancement New feature or request label Sep 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@lidge-jun
lidge-jun merged commit d5742f2 into dev Sep 23, 2026
28 checks passed
@lidge-jun
lidge-jun deleted the codex/configured-native-gpt-models branch September 23, 2026 05:18
void0x14 pushed a commit to void0x14/fucklidgejun that referenced this pull request Sep 25, 2026
…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/.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant