Python
fix(providers): mark Qwen3.8 Max Preview as vision-capable
Danila Katalshov1bc278d11736
diff --git a/coworker/providers/matrix.py b/coworker/providers/matrix.pyindex c16afa6f..fe8c9722 100644--- a/coworker/providers/matrix.py+++ b/coworker/providers/matrix.py@@ -198,6 +198,18 @@ MATRIX: dict[str, ModelEntry] = {"kimi:kimi-k2.6": ModelEntry("Kimi K2.6 · Moonshot", _AGENTIC, 256_000),"minimax:MiniMax-M2.5": ModelEntry("MiniMax M2.5 · MiniMax"),"qwen:qwen3-max": ModelEntry("Qwen3 Max · Alibaba", _AGENTIC, 256_000),+ # Qwen3.8 Max Preview (2026-07): multimodal (text/image/video/document) per Alibaba's+ # model card, unlike the text-only Qwen3 Max above — needs its own entry so the qwen+ # prefix heuristic in capabilities.py (vision=False for the whole family) doesn't+ # strip images client-side (owner report 2026-08-02). PDF unverified over the compat+ # surface, same caveat as Muse Spark, so it falls back via pdf_support.py too.+ "qwen:qwen3.8-max-preview": ModelEntry(+ "Qwen3.8 Max Preview · Alibaba",+ ModelCapabilities(+ tools=True, vision=True, parallel_tool_calls=True, streaming=True+ ),+ 1_000_000,+ ),"xai:grok-4.3": ModelEntry("Grok 4.3 · xAI", _AGENTIC, 256_000),"mistral:mistral-large-latest": ModelEntry("Mistral Large · Mistral", _AGENTIC, 128_000diff --git a/tests/test_providers.py b/tests/test_providers.pyindex 3fde1abb..c8fe29da 100644--- a/tests/test_providers.py+++ b/tests/test_providers.py@@ -516,6 +516,18 @@ def test_openrouter_vision_matches_declared_input_modalities():assert not capabilities_for(mid).vision, mid+def test_qwen38_max_preview_is_curated_vision_true():+ """Qwen3.8 Max Preview is multimodal, unlike the text-only Qwen3 Max — it needs its+ own matrix entry so the blanket qwen-prefix heuristic (vision=False) doesn't strip+ images client-side (issue: images silently replaced with a placeholder). The bare+ Qwen3 Max entry is untouched by the fix."""+ assert capabilities_for("qwen:qwen3.8-max-preview").vision is True+ assert capabilities_for("qwen:qwen3-max").vision is False+ # the heuristic alone (no provider prefix) still can't tell the two apart — the+ # matrix entry, not the heuristic, is what fixes this.+ assert capabilities_for("qwen3.8-max-preview").vision is False++def test_matrix_labels_and_custom_model_fallback():from coworker.providers.matrix import MATRIX, model_labels