Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions agent/model_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ def _strip_provider_prefix(model: str) -> str:
"llama": 131072,
# Qwen — specific model families before the catch-all.
# Official docs: https://help.aliyun.com/zh/model-studio/developer-reference/
"qwen3.6-plus": 1048576, # 1M context (DashScope/Alibaba & OpenRouter)
"qwen3-coder-plus": 1000000, # 1M context
"qwen3-coder": 262144, # 256K context
"qwen": 131072,
Expand Down
10 changes: 10 additions & 0 deletions tests/agent/test_model_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,6 +746,16 @@ def test_qwen3_coder_context_length(self, mock_fetch):
mock_fetch.return_value = {}
assert get_model_context_length("qwen3-coder") == 262144

@patch("agent.model_metadata.fetch_model_metadata")
def test_qwen3_6_plus_context_length(self, mock_fetch):
"""qwen3.6-plus has a 1M context window, not the generic 128K Qwen default."""
mock_fetch.return_value = {}
assert get_model_context_length("qwen3.6-plus") == 1048576
# Provider-prefixed variants must resolve to the same explicit entry
# via the longest-substring fallback (no portal/OR cache available).
assert get_model_context_length("qwen/qwen3.6-plus") == 1048576
assert get_model_context_length("dashscope/qwen3.6-plus") == 1048576

@patch("agent.model_metadata.fetch_model_metadata")
def test_qwen_generic_context_length(self, mock_fetch):
"""Generic qwen models still get the 128K default."""
Expand Down