Skip to content

bug(models): openai-codex provider group missing from picker — no env-var detection path for OPENAI_API_KEY #1189

@nesquena-hermes

Description

@nesquena-hermes

Summary

After the Nous live-model-fetch fix (#1174, v0.50.228), the live endpoint now returns a full catalog of Nous models. However, the openai-codex provider group — which has its own static model list in _PROVIDER_MODELS — has no automatic detection path via environment variables. It only appears if the user explicitly lists openai-codex under providers: in config.yaml.

Confirmed post-fix: a user with the Codex provider configured reported the group disappeared from the model picker entirely after pulling v0.50.228+.

Steps to reproduce

  1. Set Nous as active provider (model.provider: nous in config.yaml)
  2. Have OPENAI_API_KEY set in the environment (for Codex access via OpenAI)
  3. Open the model picker — the "OpenAI Codex" group does not appear

Contrast: OPENAI_API_KEY triggers detection of the openai provider group but not openai-codex.

Root cause

get_available_models() in api/config.py maps specific env vars to providers:

if all_env.get("OPENAI_API_KEY"):
    detected_providers.add("openai")   # ← only "openai", not "openai-codex"

openai-codex has a full static model list in _PROVIDER_MODELS["openai-codex"] (9 models) and a display name in _PROVIDER_DISPLAY, but zero detection logic. It is entirely absent from the env-var detection block (lines ~1415–1448). The only path that adds it is the config.yaml providers: section reader (line ~1453), which requires the user to manually configure it.

Since both openai-codex and openai share OPENAI_API_KEY for authentication, there is no functional reason the Codex group should require separate manual config to appear.

Expected behavior

When OPENAI_API_KEY is set, the "OpenAI Codex" model group should appear in the picker automatically alongside the "OpenAI" group — the same key authenticates both.

Proposed fix

Add detection in the env-var block in api/config.py:

if all_env.get("OPENAI_API_KEY"):
    detected_providers.add("openai")
    detected_providers.add("openai-codex")   # ← add this

Single-line change, no logic side-effects. Users who don't want the Codex group can remove it via providers: section overrides (existing mechanism).

Files

  • api/config.py line ~1424 (env-var detection block for OPENAI_API_KEY)
  • api/config.py line ~625 (_PROVIDER_MODELS["openai-codex"] static list — already populated)

Impact

All users who authenticate via OPENAI_API_KEY and have Codex models available. The group never appears unless they manually add an openai-codex: section to config.yaml, which no onboarding flow or documentation currently suggests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions