fix(metadata): bump hy3-preview static context length to 262144 - #22392
Closed
wesleysimplicio wants to merge 1 commit into
Closed
fix(metadata): bump hy3-preview static context length to 262144#22392wesleysimplicio wants to merge 1 commit into
wesleysimplicio wants to merge 1 commit into
Conversation
Problem
-------
TestTencentTokenhubContextLength::test_hy3_preview_context_length fails
on main with `assert 262144 == 256000`.
Root cause
----------
OpenRouter's live API now reports `hy3-preview` with
`context_length: 262144` (256 KiB), up from 256000 at launch.
`get_model_context_length("hy3-preview")` consults the OpenRouter
metadata cache before reaching the static fallback in
DEFAULT_CONTEXT_LENGTHS, so it returns the live value (262144) and the
test (which asserted the old static value) fails.
Fix
---
Update both sides:
- agent/model_metadata.py: bump the static fallback to 262144 so the
offline path agrees with the live API.
- tests/hermes_cli/test_tencent_tokenhub_provider.py: assert 262144 to
match the value the resolver now returns.
Tests
-----
TestTencentTokenhubContextLength passes with the fix and fails without
it (verified by stashing both edits and re-running the scoped test —
reproduces `assert 262144 == 256000`).
Closes NousResearch#22268
Contributor
There was a problem hiding this comment.
Pull request overview
Updates Hermes’ model context-length metadata for Tencent’s hy3-preview to match OpenRouter’s current reported value (262,144 tokens), fixing a failing regression test and keeping the offline static fallback consistent with the live-metadata path.
Changes:
- Bump
DEFAULT_CONTEXT_LENGTHS["hy3-preview"]from256000to262144. - Update
TestTencentTokenhubContextLength::test_hy3_preview_context_lengthto assert262144and document the rationale.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
agent/model_metadata.py |
Updates the static fallback context length for hy3-preview to 262,144. |
tests/hermes_cli/test_tencent_tokenhub_provider.py |
Updates the assertion (and adds commentary) to expect the new resolved context length. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+313
to
+314
| # the metadata cache reaches the static fallback only when offline, | ||
| # so both the live and offline paths must agree (#22268). |
Comment on lines
309
to
+313
| 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's live API now reports 262144 (256 KiB) for hy3-preview; | ||
| # the metadata cache reaches the static fallback only when offline, |
Collaborator
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
TestTencentTokenhubContextLength::test_hy3_preview_context_lengthfails onmain:Closes #22268.
Root cause
OpenRouter's live API now reports
hy3-previewwithcontext_length: 262144(256 KiB), up from 256000 at launch.get_model_context_length("hy3-preview")consults the OpenRouter metadata cache before reaching the static fallback inDEFAULT_CONTEXT_LENGTHS, so it returns the live value (262144) and the test (which asserted the old static value) fails.Fix
Update both sides:
agent/model_metadata.py: bump the static fallback to262144so the offline path agrees with the live API.tests/hermes_cli/test_tencent_tokenhub_provider.py: assert262144to match the value the resolver now returns.Tests
TestTencentTokenhubContextLengthpasses with the fix and fails without it (verified by stashing both edits and re-running the scoped test — reproducesassert 262144 == 256000). Fulltests/hermes_cli/test_tencent_tokenhub_provider.py(61 tests) green.