Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions agent/model_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,10 @@ def _strip_provider_prefix(model: str) -> str:
"grok": 131072, # catch-all (grok-beta, unknown grok-*)
# Kimi
"kimi": 262144,
# Tencent — Hy3 Preview (Hunyuan) with 256K context window
"hy3-preview": 256000,
# Tencent — Hy3 Preview (Hunyuan) with 256K context window.
# OpenRouter live metadata reports 262144 (256 * 1024); aligning the
# static fallback so cache and fallback agree (issue #22268).
"hy3-preview": 262144,
# Nemotron — NVIDIA's open-weights series (128K context across all sizes)
"nemotron": 131072,
# Arcee
Expand Down
14 changes: 13 additions & 1 deletion tests/hermes_cli/test_tencent_tokenhub_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,19 @@ class TestTencentTokenhubContextLength:
def test_hy3_preview_context_length(self):
from agent.model_metadata import get_model_context_length
ctx = get_model_context_length("hy3-preview")
assert ctx == 256000
# OpenRouter live API returns 262144 (256 * 1024); static fallback
# tracks the same value so tests pass whether resolution comes from
# live cache or static table (issue #22268).
assert ctx == 262144

def test_hy3_preview_static_fallback_matches_live(self):
"""Static DEFAULT_CONTEXT_LENGTHS entry must match OpenRouter live (issue #22268).

Pins the static value so this stays correct even when the live cache
is unavailable in test environments (CI without network).
"""
from agent.model_metadata import DEFAULT_CONTEXT_LENGTHS
assert DEFAULT_CONTEXT_LENGTHS["hy3-preview"] == 262144


# =============================================================================
Expand Down
Loading