Skip to content

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

Description

@LJCCCCCCCCC

Client or integration

Codex App

Area

Proxy and routing

Summary

When OpenCodex is configured with only a non-OpenAI provider (for example, kimi), the generated Codex model catalog still advertises bare OpenAI-family models such as gpt-5.6-sol, gpt-5.6-terra, and gpt-5.5. These models appear at the top of the Codex model picker, but selecting one immediately returns a local 404:

unexpected status 404 Not Found: No enabled canonical OpenAI provider for model: gpt-5.6-sol, url: http://127.0.0.1:10100/v1/responses

I expected the model picker to list only routable models, or for the error to explain that the canonical openai provider must first be added.

The failure is generated locally by the router in roughly 10 ms, before any upstream network call. Because it is surfaced as an HTTP 404, it initially looks like a URL, VPN, proxy, or TUN networking problem.

Reproduction

  1. Log into a non-OpenAI provider and configure it as the only provider. In this case, the provider was kimi and there was no providers.openai entry in ~/.opencodex/config.json.
  2. Start OpenCodex and sync the model catalog.
  3. Open the Codex App model picker.
  4. Select gpt-5.6-sol (or another bare gpt-* model).
  5. Send any message.
  6. Observe an immediate 404 from http://127.0.0.1:10100/v1/responses.

The generated ~/.codex/opencodex-catalog.json contained the bare OpenAI-family models even though no canonical openai provider was enabled.

Root cause observed

In src/router.ts, routeModel() classifies bare IDs matching gpt-*, o1-*, o3-*, or o4-* as OpenAI-family models and routes them only through providers.openai. If that provider is missing or disabled, NoEnabledOpenAiProviderError is thrown and surfaced as 404. The catalog generation path nevertheless advertises these models.

Workaround verified

ocx provider add openai
ocx sync
ocx restart

After restarting, /api/providers included the canonical openai provider and a real gpt-5.6-sol request returned HTTP 200. A running server did not reflect the newly added provider after ocx sync; ocx restart was required.

Suggested fixes

  1. When no enabled canonical openai provider exists, omit bare OpenAI-family models from the generated catalog or mark them unavailable.
  2. Make NoEnabledOpenAiProviderError actionable, for example: Model gpt-5.6-sol requires the canonical openai provider. Run: ocx provider add openai && ocx restart.
  3. Hot-reload provider configuration after ocx provider add / ocx sync, or explicitly tell the user that ocx restart is required.

Version

2.7.31

Operating system

macOS 26.5.2 (Build 25F84), Apple Silicon

Provider and model

Canonical OpenAI provider missing / gpt-5.6-sol

Logs or error output

unexpected status 404 Not Found: No enabled canonical OpenAI provider for model: gpt-5.6-sol, url: http://127.0.0.1:10100/v1/responses

{"requestedModel":"gpt-5.6-sol","provider":"unknown","status":404,"durationMs":10,"usageStatus":"unreported","errorCode":"http_404","upstreamError":"No enabled canonical OpenAI provider for model: gpt-5.6-sol"}

Screenshots and supporting files

None.

Redacted configuration

{
  "port": 10100,
  "providers": {
    "kimi": {
      "adapter": "openai-chat",
      "baseUrl": "https://api.kimi.com/coding/v1",
      "authMode": "oauth",
      "defaultModel": "kimi-k2.7-code",
      "models": ["k3", "kimi-k2.7-code"]
    }
  },
  "defaultProvider": "kimi"
}

Checks

  • I searched existing issues and documentation.
  • I removed secrets, tokens, account details, request credentials, and personal data.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions