Skip to content

fix(metadata): qwen3.6-plus has a 1M context window (#27008)#27068

Closed
haran2001 wants to merge 1 commit into
NousResearch:mainfrom
haran2001:fix/qwen36-plus-context-length
Closed

fix(metadata): qwen3.6-plus has a 1M context window (#27008)#27068
haran2001 wants to merge 1 commit into
NousResearch:mainfrom
haran2001:fix/qwen36-plus-context-length

Conversation

@haran2001

Copy link
Copy Markdown
Contributor

Summary

Fixes #27008.

qwen3.6-plus was missing from DEFAULT_CONTEXT_LENGTHS in agent/model_metadata.py. The longest-substring fallback then matched the generic "qwen": 131072 catch-all, dropping the effective context limit from 1,048,576 → 131,072 tokens, prematurely lowering the compression threshold and producing misleading "compression model context lower than main model" warnings during long sessions on DashScope / Alibaba / OpenRouter.

Fix

Add an explicit entry before the generic catch-all:

"qwen3.6-plus": 1048576,      # 1M context (DashScope/Alibaba & OpenRouter)
"qwen3-coder-plus": 1000000,
"qwen3-coder": 262144,
"qwen": 131072,

The lookup is longest-key-first substring matching, so this works for bare qwen3.6-plus and all provider-prefixed variants (qwen/qwen3.6-plus, dashscope/qwen3.6-plus, …).

Not a duplicate of #6599

PR #6599's description mentions touching agent/model_metadata.py but its actual diff only adds the model to hermes_cli/models.py (the curated model list). The metadata table is independent and still defaults to 128K without this PR.

Tests

bash scripts/run_tests.sh tests/agent/test_model_metadata.py -k qwen -q
# 4 passed in 69.15s

New test_qwen3_6_plus_context_length asserts 1,048,576 for bare and both provider-prefixed variants. Existing test_qwen_generic_context_length (asserting 131072 for unknown qwen* IDs) still passes — no regression.

qwen3.6-plus did not have an explicit entry in DEFAULT_CONTEXT_LENGTHS,
so the longest-substring fallback matched the generic 'qwen': 131072
catch-all. That dropped the effective context limit from 1,048,576
tokens to 131,072, prematurely lowered the compression threshold, and
produced misleading warnings about main/compression context mismatch
in long sessions.

Add an explicit 'qwen3.6-plus': 1048576 entry before the catch-all and
cover it with a regression test (bare, qwen/, and dashscope/ prefixes).

Note: PR NousResearch#6599 also mentions touching model_metadata.py but the actual
diff only edits hermes_cli/models.py, so this fix is independent and
not duplicated by that PR.

Closes NousResearch#27008
@cardtest15-coder

This comment was marked as spam.

@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent loop, run_agent.py, prompt builder labels May 16, 2026
teknium1 added a commit that referenced this pull request May 17, 2026
…tors

Adds release-note attribution mappings for the contributors from group 5:
- @haran2001 (PR #27070, #27068)
- @ms-alan (PR #26443)
- @godlin-gh (PR #26118)
- @wesleysimplicio (PR #25777, ext-email form)
- @Carry00 (PR #26851)
- @alaamohanad169-ship-it (PR #26036)
- @hawknewton (PR #26294)

(YanzhongSu PR #25879 and flamiinngo PR #27231 already mapped.)
@teknium1

Copy link
Copy Markdown
Contributor

Merged via PR #27382 — your commit was cherry-picked onto current main as part of a batch salvage of low-risk new-contributor PRs. Authorship preserved (fix(metadata): qwen3.6-plus has a 1M context window (#27008)). Thanks for the contribution.

@teknium1 teknium1 closed this May 17, 2026
gweeteve pushed a commit to gweeteve/hermes-agent that referenced this pull request Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/agent Core agent loop, run_agent.py, prompt builder P2 Medium — degraded but workaround exists type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(metadata): qwen3.6-plus falls back to generic qwen 131K context instead of 1M

4 participants