Skip to content

fix(metadata): bump hy3-preview static context length to 262144 - #22392

Closed
wesleysimplicio wants to merge 1 commit into
NousResearch:mainfrom
wesleysimplicio:fix/metadata-hy3-preview-context-length
Closed

fix(metadata): bump hy3-preview static context length to 262144#22392
wesleysimplicio wants to merge 1 commit into
NousResearch:mainfrom
wesleysimplicio:fix/metadata-hy3-preview-context-length

Conversation

@wesleysimplicio

Copy link
Copy Markdown
Contributor

Problem

TestTencentTokenhubContextLength::test_hy3_preview_context_length fails on main:

assert 262144 == 256000

Closes #22268.

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). Full tests/hermes_cli/test_tencent_tokenhub_provider.py (61 tests) green.

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
Copilot AI review requested due to automatic review settings May 9, 2026 08:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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"] from 256000 to 262144.
  • Update TestTencentTokenhubContextLength::test_hy3_preview_context_length to assert 262144 and 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,
@alt-glitch alt-glitch added type/bug Something isn't working P3 Low — cosmetic, nice to have comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists labels May 9, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #22270 — same fix (hy3-preview context length 256000→262144, same two files). Also overlaps with #22184.

@wesleysimplicio

Copy link
Copy Markdown
Contributor Author

Closing: duplicate of #22574 (both Closes #22268, both bump hy3-preview static context length to 262144 in agent/model_metadata.py). #22574 adds an extra regression test test_hy3_preview_static_fallback_matches_live that guards against future drift. Consolidating review on #22574.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint duplicate This issue or pull request already exists P3 Low — cosmetic, nice to have type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(metadata): hy3-preview context length test fails (256000 vs 262144)

3 participants