Skip to content

[Bug] Telegram /model picker missing gpt-5.4 for openai-codex provider (stale _PROVIDER_MODELS hardcoded list) #6595

@rexliu1912-star

Description

@rexliu1912-star

Bug Description

The Telegram /model picker does not show gpt-5.4 or gpt-5.4-mini when selecting the openai-codex provider, even though both models are available and functional.

Root Cause

In hermes_cli/models.py, the _PROVIDER_MODELS dict hardcodes the OpenAI Codex model list:

_PROVIDER_MODELS = {
    ...
    "openai-codex": ["gpt-5.3-codex", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1-codex-max"],
    ...
}

This list was written for v0.7.0 and has not been updated to include gpt-5.4 and gpt-5.4-mini, which are now the current production models.

The list_authenticated_providers() function in model_switch.py uses _PROVIDER_MODELS to build the picker, not codex_models.get_codex_model_ids() which dynamically queries the Codex API/cache and correctly returns gpt-5.4.

Impact

  1. /model Telegram picker shows no gpt-5.4 under openai-codex — users must know the exact model name
  2. Even when using /model gpt-5.4 --provider openai-codex --global, hermes emits a false warning: "Could not reach OpenAI Codex API to validate gpt-5.4" — because validation falls back to _PROVIDER_MODELS membership check

Steps to Reproduce

  1. Configure hermes with openai-codex provider (authenticated via device code or CLI token import)
  2. In Telegram, send /model
  3. Select openai-codex from provider list
  4. Observe: only gpt-5.3-codex, gpt-5.2-codex, gpt-5.1-codex-mini, gpt-5.1-codex-max are shown — no gpt-5.4

Workaround

By-pass the picker:

/model gpt-5.4 --provider openai-codex --global

This works despite the warning.

Suggested Fix

Option A (quick fix): Update _PROVIDER_MODELS["openai-codex"] in models.py to prepend current models:

"openai-codex": ["gpt-5.4", "gpt-5.4-mini", "gpt-5.3-codex", "gpt-5.2-codex", "gpt-5.1-codex-mini", "gpt-5.1-codex-max"],

Option B (proper fix): In list_authenticated_providers() / model_switch.py, replace the _PROVIDER_MODELS["openai-codex"] lookup with a call to codex_models.get_codex_model_ids(), which already handles dynamic discovery from the Codex API cache.

Environment

  • Hermes Agent v0.7.0
  • openai-codex provider (credential_pool, device_code source)
  • Verified: codex_models.get_codex_model_ids() returns ["gpt-5.4", "gpt-5.4-mini", ...] correctly
  • Verified: /model gpt-5.4 --provider openai-codex routes to the model successfully after the fix in _PROVIDER_MODELS

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions