fix(codex): drop unsupported pro defaults

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 <taneli.mielikainen@iki.fi>
This commit is contained in:
Vadelma
2026-08-18 06:02:09 -07:00
committed by Teknium
parent de213b5210
commit 3a87f8767a
2 changed files with 23 additions and 9 deletions
+3 -8
View File
@@ -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",)),
+20 -1
View File
@@ -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)