From 74f4f3150af3b393efc45739760a7395d819e2b1 Mon Sep 17 00:00:00 2001 From: alberto <914199+alblez@users.noreply.github.com> Date: Fri, 8 May 2026 23:06:50 -0500 Subject: [PATCH] fix(metadata): update hy3-preview context length to 262144 OpenRouter's live API now reports hy3-preview with context_length=262144 (up from the original 256000). Update both the static fallback table in DEFAULT_CONTEXT_LENGTHS and the corresponding test assertion. The test was failing because get_model_context_length() hits the OpenRouter metadata cache (step 6 in resolution order) which returns 262144, taking priority over the stale hardcoded 256000 in step 8. --- agent/model_metadata.py | 4 ++-- tests/hermes_cli/test_tencent_tokenhub_provider.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/agent/model_metadata.py b/agent/model_metadata.py index 4df8a6077791..db6885ecf1fa 100644 --- a/agent/model_metadata.py +++ b/agent/model_metadata.py @@ -210,8 +210,8 @@ 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 (262144 tokens) + "hy3-preview": 262144, # Nemotron — NVIDIA's open-weights series (128K context across all sizes) "nemotron": 131072, # Arcee diff --git a/tests/hermes_cli/test_tencent_tokenhub_provider.py b/tests/hermes_cli/test_tencent_tokenhub_provider.py index 62cecaeb0c31..d1035dcfa27d 100644 --- a/tests/hermes_cli/test_tencent_tokenhub_provider.py +++ b/tests/hermes_cli/test_tencent_tokenhub_provider.py @@ -309,7 +309,7 @@ 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 + assert ctx == 262144 # =============================================================================