fix(openai): include canonical API picker identity in Astra discovery gate

(cherry picked from commit de57e601193a955a69201e1a274d5ccab83a7634)
This commit is contained in:
Eva
2026-09-05 13:24:19 +07:00
committed by kshitij
parent 328542d807
commit fdb76ce643
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -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",
}
+1 -1
View File
@@ -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