Skip to content

fix(metadata): add qwen3.6-plus 1M context length (#27008) - #27057

Closed
alaamohanad169-ship-it wants to merge 2 commits into
NousResearch:mainfrom
alaamohanad169-ship-it:fix/qwen3.6-plus-context-length
Closed

fix(metadata): add qwen3.6-plus 1M context length (#27008)#27057
alaamohanad169-ship-it wants to merge 2 commits into
NousResearch:mainfrom
alaamohanad169-ship-it:fix/qwen3.6-plus-context-length

Conversation

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor

Description

Adds qwen3.6-plus to DEFAULT_CONTEXT_LENGTHS in agent/model_metadata.py with the correct 1M (1,048,576) context window.

Previously, qwen3.6-plus was missing from the dict and fell back to the generic qwen: 131072 entry, causing:

  • Premature context compression in long sessions
  • Degraded reasoning quality due to unnecessary truncation
  • Misleading context mismatch warnings

Changes

  • agent/model_metadata.py: Added "qwen3.6-plus": 1048576 before the generic qwen fallback

Testing

  • Verified the entry is placed before the generic qwen catch-all (substring matching is longest-first, so qwen3.6-plus matches before qwen)
  • No other Qwen entries are affected

Related

Closes #27008

Changes the enriched text format in _enrich_message_with_vision from
bracket-heavy format to a more natural conversational format with 📷
emoji prefix and regular punctuation. This helps non-vision models
like MiniMax M2.7 better understand the vision analysis results.

Closes #25900
qwen3.6-plus was missing from DEFAULT_CONTEXT_LENGTHS, causing it to
fall back to the generic qwen 131072 entry. The actual context window
is 1048576 tokens (1M) per DashScope/Alibaba docs.

This caused:
- Premature context compression in long sessions
- Degraded reasoning quality
- Misleading context mismatch warnings

Fix: add explicit qwen3.6-plus: 1048576 entry before the generic
qwen fallback in agent/model_metadata.py.

Ref: #27008
@alaamohanad169-ship-it
alaamohanad169-ship-it force-pushed the fix/qwen3.6-plus-context-length branch from 331c205 to fbdfa18 Compare May 16, 2026 19:19
@alt-glitch alt-glitch added type/bug Something isn't working P2 Medium — degraded but workaround exists comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery area/config Config system, migrations, profiles labels May 16, 2026
@alt-glitch

Copy link
Copy Markdown
Collaborator

Duplicate of #27068 which makes the same qwen3.6-plus metadata fix with tests and without unrelated changes.

Note: this PR also modifies gateway/run.py (vision auto-analysis message formatting) which is unrelated to the metadata fix described in the title/body — scope creep.

See also: #6599 (broader qwen3.6-plus model catalog addition, open).

@alaamohanad169-ship-it

Copy link
Copy Markdown
Contributor Author

Closing as duplicate of #27068, which implements the same qwen3.6-plus metadata fix with proper tests and without the unrelated gateway/run.py changes. Thanks @alt-glitch for the review and flagging this.

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

Labels

area/config Config system, migrations, profiles comp/agent Core agent runtime: loop, agent_init, prompt builder, context-compression, responses endpoint comp/gateway Gateway runner, session dispatch, delivery 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

2 participants