Skip to content

fix(catalog): stop offering Codex-retired models on the OAuth path - #450

Open
lucifer78907 wants to merge 1 commit into
initializ:mainfrom
lucifer78907:fix/codex-oauth-models
Open

fix(catalog): stop offering Codex-retired models on the OAuth path#450
lucifer78907 wants to merge 1 commit into
initializ:mainfrom
lucifer78907:fix/codex-oauth-models

Conversation

@lucifer78907

Copy link
Copy Markdown
Contributor

Type of Change

  • Bug fix
  • New feature
  • Enhancement / refactor
  • New skill
  • Documentation
  • CI / build

Description

Selecting gpt-5.4 after signing in with ChatGPT produced an agent that
failed on its first call. gpt-5.4 and gpt-5.4-mini retired from Codex
ChatGPT sign-in on 2026-08-31
(gpt-5.6-terra and gpt-5.6-luna are the
documented replacements), and nano tiers ship API-only and were never served
there. Both the CLI wizard and forge-ui still offered all of them for
browser-based OAuth login.

OpenAI states the API and API-key Codex are unaffected by those retirements,
so the retired models stay selectable with an API key — removing them
outright would break working setups.

Summary

  • The CLI's OAuth/API-key split was fakeprovider_step.go declared
    openAIOAuthModels and openAIAPIKeyModels but built both from the same
    unfiltered openAIModelOptions(). Two names, one list; the intent was
    there, the filtering never was.
  • The catalog couldn't express the splitcatalog.Model was
    {Label, ModelID}, leaving nowhere to record "API-key only", so the
    wizard could not have filtered even if it tried.
  • forge-ui duplicated the entire OpenAI model list instead of reading
    the catalog — precisely the drift the catalog package doc says it exists
    to prevent. They had already diverged: forge-ui carried the 5.6 family,
    the catalog didn't.
  • gpt-5.4 was hardcoded as the default in four independent places
    the catalog, forge-ui, init.go's template data, and
    runtime/config.go's defaultModelForProvider. That last one means any
    agent whose forge.yaml omits a model was running on a retired model.
  • The whole 5.6 family and gpt-6-astra were missing from the catalog
    entirely.

Changes

File Change
forge-core/catalog/catalog.go Model.APIKeyOnly, plus Provider.OAuthModels() / APIKeyModels()
forge-core/catalog/providers.go Added gpt-6-astra + gpt-5.6-{sol,terra,luna}; marked gpt-5.4, gpt-5-mini, gpt-5-nano, gpt-4.1 as APIKeyOnly; DefaultModelgpt-5.6-terra; fixed the stale description
forge-cli/internal/tui/steps/provider_step.go Filters per auth method via the new accessors
forge-ui/handlers_create.go Projects the OpenAI entry from the catalog instead of duplicating it, so the two cannot drift again
forge-core/runtime/config.go Runtime default → gpt-5.6-terra
forge-cli/cmd/init.go Reads catalog.DefaultModel instead of keeping its own switch

Deliberate exclusions. Pro-only gpt-5.3-codex-spark and
previous-generation gpt-5.5 are Codex OAuth models but are not offered:
codex-spark fails for non-Pro accounts, and gpt-5.5 is on a retirement path.
gpt-6-astra is offered despite a staged rollout, but is not the
default.

Behaviour change worth flagging: existing agents whose forge.yaml
omits a model move from gpt-5.4 to gpt-5.6-terra on next run. Correct
for OAuth users; a real change for API-key users, who could still use
gpt-5.4.

Open question for reviewers: gpt-5-mini and gpt-5-nano don't match
OpenAI's naming (the real ids appear to be gpt-5.4-mini /
gpt-5.4-nano), so they may be broken on the API-key path too. I left
the id strings untouched and only moved them to API-key-only rather than
guess — worth a second opinion.

General Checklist

  • Tests pass for affected modules (go test ./...)
  • Code is formatted (gofmt -w)
  • Linter passes (golangci-lint run)
  • go vet reports no issues
  • No new egress domains added without justification

Notes on the unchecked boxes:

  • gofmt -w deliberately not run — the working copy is CRLF, so it
    would rewrite every file in the module and bury the change. The diff was
    verified to contain no line-ending churn. Please confirm in CI.
  • golangci-lint not installed locally, so it hasn't been run.
  • Tests were run on Windows. forge-core/catalog, forge-core/runtime
    and TestBuildTemplateData_DefaultModels all pass. These forge-cli/cmd
    and forge-ui/uiconfig failures are pre-existing and environmental (Unix
    permission bits, executable bits, credential lookup) — confirmed by
    stashing the changes and re-running on a clean tree:
    TestResolveTryProvider_Ollama,
    TestResolveTryProvider_NoCredsNonInteractive,
    TestQuickstartPreset_ScaffoldsValidConfig,
    TestImportSkillFolder_FullFolder, TestSetEnvFileValue_*.

Tests added

  • TestOpenAIOAuthModelsExcludeRetired — asserts no known-retired id
    appears in OAuthModels(), and that DefaultModel is itself
    OAuth-reachable, so the wizard can never hand an OAuth user a default that
    fails.
  • TestDefaultModelForProvider and TestBuildTemplateData_DefaultModels
    updated for the new default.

Not addressed

anthropic, gemini and ollama model lists are still hardcoded in
forge-ui — the catalog holds no Models for them. Same drift risk, left for
a follow-up.

Related Issues

Reference: Codex models ·
Using Codex with your ChatGPT plan

gpt-5.4 and gpt-5.4-mini retired from Codex ChatGPT sign-in on 2026-08-31
(gpt-5.6-terra and gpt-5.6-luna are the documented replacements), and nano
tiers ship API-only and were never served there. Both the CLI wizard and
forge-ui still offered them for browser-based OAuth login, so an agent
scaffolded that way failed on its first call. OpenAI states the API and
API-key Codex are unaffected, so these remain selectable with a key.

Four problems, not one:

- provider_step.go declared openAIOAuthModels and openAIAPIKeyModels but
  built both from the same unfiltered openAIModelOptions(), so the split
  existed in name only.
- catalog.Model had no way to express it: {Label, ModelID} left nowhere to
  record "API-key only", so the wizard could not have filtered even if it
  tried.
- forge-ui duplicated the whole OpenAI model list instead of reading the
  catalog — exactly the drift the catalog package doc says it exists to
  prevent. The two had already diverged: forge-ui carried the 5.6 family,
  the catalog did not.
- gpt-5.4 was hardcoded as the default in four independent places: the
  catalog, forge-ui, init.go's template data, and runtime/config.go's
  defaultModelForProvider — the last meaning any agent whose forge.yaml
  omits a model was *running* on a retired model.

Changes:

- catalog.Model gains APIKeyOnly, plus Provider.OAuthModels() /
  APIKeyModels() accessors.
- OpenAI entry gains gpt-6-astra and the gpt-5.6 family (sol/terra/luna);
  gpt-5.4, gpt-5-mini, gpt-5-nano and gpt-4.1 are marked APIKeyOnly.
  DefaultModel and the stale "GPT 5.4, GPT 5 Mini, GPT 5 Nano" description
  both updated.
- provider_step.go filters per auth method via the new accessors.
- forge-ui projects the OpenAI entry from the catalog rather than
  duplicating it, so the two cannot drift again.
- runtime/config.go and init.go default to gpt-5.6-terra; init.go now reads
  catalog.DefaultModel instead of keeping its own switch.

Pro-only gpt-5.3-codex-spark and previous-generation gpt-5.5 are Codex
OAuth models but deliberately not offered: codex-spark fails for non-Pro
accounts and gpt-5.5 is on a retirement path. gpt-6-astra is included
despite a staged rollout, but is not the default.

Tests: TestOpenAIOAuthModelsExcludeRetired asserts no known-retired id
appears in OAuthModels() and that DefaultModel is itself OAuth-reachable,
so the wizard can never hand an OAuth user a default that fails.
TestDefaultModelForProvider and TestBuildTemplateData_DefaultModels updated
for the new default.

Note: the runtime default change means existing agents whose forge.yaml
omits a model move from gpt-5.4 to gpt-5.6-terra on next run.

Refs https://learn.chatgpt.com/docs/models
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant