From fdb76ce64379ef1e2eac3455d7663a5a45dff5b4 Mon Sep 17 00:00:00 2001 From: Eva Date: Sat, 5 Sep 2026 13:24:19 +0700 Subject: [PATCH] fix(openai): include canonical API picker identity in Astra discovery gate (cherry picked from commit de57e601193a955a69201e1a274d5ccab83a7634) --- hermes_cli/models.py | 2 +- tests/agent/test_astra_baseline_runtime.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/hermes_cli/models.py b/hermes_cli/models.py index afe926e119..0784e3fd55 100644 --- a/hermes_cli/models.py +++ b/hermes_cli/models.py @@ -1518,7 +1518,7 @@ def _normalized_cache_slug(provider: Optional[str]) -> str: def _model_requires_account_discovery(provider: Optional[str], model: str) -> bool: """Astra names cannot confer API/OAuth entitlement through picker state.""" - return _normalized_cache_slug(provider) in {"openai", "openai-codex"} and str(model or "").strip().lower().rsplit("/", 1)[-1] in { + return _normalized_cache_slug(provider) in {"openai", "openai-api", "openai-codex"} and str(model or "").strip().lower().rsplit("/", 1)[-1] in { "gpt-6-astra", "gpt-6-astra-900k", } diff --git a/tests/agent/test_astra_baseline_runtime.py b/tests/agent/test_astra_baseline_runtime.py index f3d6fae546..4a6e108336 100644 --- a/tests/agent/test_astra_baseline_runtime.py +++ b/tests/agent/test_astra_baseline_runtime.py @@ -81,7 +81,7 @@ def test_astra_900k_opt_in_preserves_live_limits_and_wire_contract(monkeypatch, @pytest.mark.parametrize("provider,model", [ - ("openai-codex", "gpt-6-astra"), ("openai-codex", "gpt-6-astra-900k"), ("openai", "gpt-6-astra"), + ("openai-codex", "gpt-6-astra"), ("openai-codex", "gpt-6-astra-900k"), ("openai-api", "gpt-6-astra"), ]) def test_picker_revalidates_cached_astra_and_never_injects_saved_entitlement(monkeypatch, tmp_path, provider, model): from hermes_cli import models