Python
fix: detect Ollama vision models from naming conventions (fixes #337)
Manav.Shrivastavabfbbeee48cbc
diff --git a/coworker/providers/capabilities.py b/coworker/providers/capabilities.pyindex f096ff3a..2548c1b4 100644--- a/coworker/providers/capabilities.py+++ b/coworker/providers/capabilities.py@@ -24,9 +24,12 @@ def capabilities_for(model: str) -> ModelCapabilities:# Ollama (local) models vary widely and many fake/mishandle parallel tool calls — assume# tools work (we only point at tool-capable models) but stay conservative otherwise.+ # Vision is detected from common model naming conventions (-vl, vision, llava, etc.).if provider == "ollama":+ _vision_patterns = ("-vl", "vision", "llava", "bakllava", "cogvlm", "minicpm-v")+ has_vision = any(p in name for p in _vision_patterns)return ModelCapabilities(- tools=True, vision=False, parallel_tool_calls=False, streaming=True+ tools=True, vision=has_vision, parallel_tool_calls=False, streaming=True)# Cloud-account providers (custom-added ids; curated ones answered from the matrix).