Skip to content

The agent that grows with you

test(models): pin native Anthropic picker to aggregator flagships

xxxigme306374e207b
diff --git a/tests/hermes_cli/test_anthropic_picker_curated.py b/tests/hermes_cli/test_anthropic_picker_curated.py
index 6465a87396a..198aa90371a 100644
--- a/tests/hermes_cli/test_anthropic_picker_curated.py
+++ b/tests/hermes_cli/test_anthropic_picker_curated.py
@@ -16,18 +16,38 @@ from unittest.mock import patch
from hermes_cli import models as M
+def test_anthropic_native_list_keeps_aggregator_flagships():
+ """Native Anthropic must list the same current flagships OpenRouter/Nous already ship.
+
+ Aggregator catalogs get the new aliases first; the native curated list is what
+ `/model` falls back to when live `/v1/models` lags or 401s. Newest-first order
+ is the contract that keeps Fable 5.1 / Opus 5 from hiding behind older 4.x ids.
+ """
+ or_ids = {mid for mid, _ in M.OPENROUTER_MODELS}
+ native = M._PROVIDER_MODELS["anthropic"]
+ for slug in ("claude-fable-5.1", "claude-opus-5"):
+ assert f"anthropic/{slug}" in or_ids
+ assert slug in native
+ assert native.index("claude-fable-5.1") < native.index("claude-fable-5")
+ assert native.index("claude-opus-5") < native.index("claude-opus-4-8")
+
+
def test_anthropic_curated_alias_survives_when_live_omits_it():
"""A curated alias missing from /v1/models still surfaces (first)."""
curated = M._PROVIDER_MODELS["anthropic"]
+ assert "claude-fable-5.1" in curated # sanity: newest Fable alias is curated
assert "claude-fable-5" in curated # sanity: the alias is curated
+ assert "claude-opus-5" in curated # sanity: native flagship matches aggregators
assert "claude-sonnet-5" in curated # newest Sonnet alias is curated
- # Live catalog the API would actually return — no fable-5.
+ # Live catalog the API would actually return — no fable-5.1 / opus-5.
live = ["claude-opus-4-8", "claude-sonnet-4-6", "claude-haiku-4-5-20251001"]
with patch.object(M, "_fetch_anthropic_models", return_value=live):
result = M.provider_model_ids("anthropic")
+ assert "claude-fable-5.1" in result
assert "claude-fable-5" in result
+ assert "claude-opus-5" in result
assert "claude-sonnet-5" in result
# Curated order is preserved at the front.
assert result[:len(curated)] == list(curated)
@@ -48,7 +68,8 @@ def test_anthropic_merge_dedupes_overlap_and_appends_live_only():
# Live-only entry is preserved (discovery still works for unknown models).
assert "claude-future-9-99" in result
# Curated entries lead, live-only trails.
- assert result.index("claude-fable-5") < result.index("claude-future-9-99")
+ assert result.index("claude-fable-5.1") < result.index("claude-future-9-99")
+ assert result.index("claude-opus-5") < result.index("claude-future-9-99")
def test_anthropic_falls_back_to_curated_when_live_unavailable():
@@ -57,4 +78,6 @@ def test_anthropic_falls_back_to_curated_when_live_unavailable():
result = M.provider_model_ids("anthropic")
assert result == list(M._PROVIDER_MODELS["anthropic"])
+ assert "claude-fable-5.1" in result
+ assert "claude-opus-5" in result
assert "claude-fable-5" in result