From 3a87f8767a71b97ca0de9553ae38bef4b5c84f75 Mon Sep 17 00:00:00 2001 From: Vadelma Date: Tue, 18 Aug 2026 06:02:09 -0700 Subject: [PATCH] fix(codex): drop unsupported pro defaults MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Port the stale PR #61665 behavior to current main. The original two-file contribution is by yungchentang; this candidate preserves its scoped Codex OAuth fallback intent. Co-authored-by: Taneli Mielikäinen --- hermes_cli/codex_models.py | 11 +++-------- tests/hermes_cli/test_codex_models.py | 21 ++++++++++++++++++++- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/hermes_cli/codex_models.py b/hermes_cli/codex_models.py index 021d31918b..f058107676 100644 --- a/hermes_cli/codex_models.py +++ b/hermes_cli/codex_models.py @@ -13,14 +13,12 @@ import os logger = logging.getLogger(__name__) DEFAULT_CODEX_MODELS: List[str] = [ - # GPT-5.6 series (Sol/Terra/Luna + -pro high-effort modes) — GA 2026-07-09 - # (previewed 2026-06-26). + # GPT-5.6 series (Sol/Terra/Luna). The public API exposes "-pro" + # variants, but the ChatGPT Codex OAuth backend rejects them with HTTP 400, + # so the curated offline fallback must not surface those dead choices. "gpt-5.6-sol", - "gpt-5.6-sol-pro", "gpt-5.6-terra", - "gpt-5.6-terra-pro", "gpt-5.6-luna", - "gpt-5.6-luna-pro", "gpt-5.5", "gpt-5.4-mini", "gpt-5.4", @@ -54,11 +52,8 @@ DEFAULT_CODEX_MODELS: List[str] = [ _FORWARD_COMPAT_TEMPLATE_MODELS: List[tuple[str, tuple[str, ...]]] = [ ("gpt-5.6-sol", ("gpt-5.5", "gpt-5.4")), - ("gpt-5.6-sol-pro", ("gpt-5.5", "gpt-5.4")), ("gpt-5.6-terra", ("gpt-5.5", "gpt-5.4")), - ("gpt-5.6-terra-pro", ("gpt-5.5", "gpt-5.4")), ("gpt-5.6-luna", ("gpt-5.5", "gpt-5.4")), - ("gpt-5.6-luna-pro", ("gpt-5.5", "gpt-5.4")), ("gpt-5.5", ("gpt-5.4", "gpt-5.4-mini", "gpt-5.3-codex")), ("gpt-5.4-mini", ("gpt-5.3-codex",)), ("gpt-5.4", ("gpt-5.3-codex",)), diff --git a/tests/hermes_cli/test_codex_models.py b/tests/hermes_cli/test_codex_models.py index 348bc2f1f7..367f4df833 100644 --- a/tests/hermes_cli/test_codex_models.py +++ b/tests/hermes_cli/test_codex_models.py @@ -1,7 +1,26 @@ import json from unittest.mock import patch -from hermes_cli.codex_models import DEFAULT_CODEX_MODELS, get_codex_model_ids +from hermes_cli.codex_models import ( + DEFAULT_CODEX_MODELS, + _FORWARD_COMPAT_TEMPLATE_MODELS, + get_codex_model_ids, +) + + +CHATGPT_REJECTED_CODEX_PRO_SLUGS = { + "gpt-5.6-sol-pro", + "gpt-5.6-terra-pro", + "gpt-5.6-luna-pro", +} + + +def test_curated_codex_fallback_excludes_chatgpt_rejected_pro_slugs(): + """OAuth fallback must not offer slugs rejected by ChatGPT Codex.""" + template_models = {model for model, _fallbacks in _FORWARD_COMPAT_TEMPLATE_MODELS} + + assert CHATGPT_REJECTED_CODEX_PRO_SLUGS.isdisjoint(DEFAULT_CODEX_MODELS) + assert CHATGPT_REJECTED_CODEX_PRO_SLUGS.isdisjoint(template_models)