You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
test(vision): test_vision_ollama CI path sends images to non-vision model, causing 400 Bad Request #1185
In CI, test/backends/test_vision_ollama.py::test_image_block_in_instruction and ::test_image_block_in_chat both fail with an Ollama 400 Bad Request error:
```
ollama._client.ResponseError: model does not support vision
r = <Response [400 Bad Request]>
kwargs = {'json': {'model': 'granite4.1:3b', 'messages': [{'role': 'user', 'images': [...]}], ...}}
```
These tests are marked @pytest.mark.ollama, @pytest.mark.e2e (not qualitative), so CI runs them against the live Ollama server. They were observed failing on PR #1168.
Root cause
The m_session fixture has two branches:
```python
if gh_run == 1:
m = start_session(model_options={ModelOption.MAX_NEW_TOKENS: 5}) # no model_id
else:
m = start_session("ollama", model_id="granite3.2-vision", ...)
```
The CI branch (gh_run == 1) calls start_session() with no backend or model ID, which resolves to the CI default — granite4.1:3b. That model does not support vision. The else branch correctly specifies granite3.2-vision.
The Ollama instance in CI is started with granite4.1:3b (the standard non-vision default); granite3.2-vision is not pulled there.
This was introduced in commit a93949a5 (2026-01-26), whose message noted "Issue to be created" but it was never filed.
Expected behaviour
Either:
The CI fixture branch also specifies granite3.2-vision, and the CI workflow pulls that model before running the vision tests; or
The tests skip when no vision-capable model is available (detected via the Ollama model list or a dedicated fixture check).
Option 2 is safer — it degrades gracefully if the model is absent rather than hard-coding a specific model name in two places.
Notes
The structural assertions (checking that images were correctly embedded in the Ollama prompt payload) are the real value of these tests; they are not qualitative.
The quality assertion ("yes" or "no" in the response) is already gated behind if not gh_run == 1:, so option 1 would unlock that too.
CICD=1 (CI):start_session(...) is called with no model_id, so it falls through to the default IBM_GRANITE_4_1_3B (granite4.1:3b) — text-only. The tests then attach an image and Ollama rejects it with 400 model does not support vision.
CICD unset (local): the else branch explicitly names granite3.2-vision, so it passes — provided that model is pulled.
CI only pulls granite4.1:3b (quality.yml), so no vision model exists there, even though conftest's warmup loop attempts granite3.2-vision (that attempt fails silently). Because the 400 aborts before _generate_log.prompt is populated, the structural assertions — the real value of these tests — never run in CI at all.
Root cause: the CI branch of the fixture forgot to name a vision model and fell back to the text-only default. Introduced in a93949a5.
Activity
planetf1 commentedon Jun 2, 2026
Failure mechanism
m_sessionpicks the model from theCICDenv var:CICD=1(CI):start_session(...)is called with nomodel_id, so it falls through to the defaultIBM_GRANITE_4_1_3B(granite4.1:3b) — text-only. The tests then attach an image and Ollama rejects it with400 model does not support vision.CICDunset (local): theelsebranch explicitly namesgranite3.2-vision, so it passes — provided that model is pulled.CI only pulls
granite4.1:3b(quality.yml), so no vision model exists there, even though conftest's warmup loop attemptsgranite3.2-vision(that attempt fails silently). Because the400aborts before_generate_log.promptis populated, the structural assertions — the real value of these tests — never run in CI at all.Root cause: the CI branch of the fixture forgot to name a vision model and fell back to the text-only default. Introduced in
a93949a5.test(backends): fix vision Ollama tests failing in CI with 400 model …
test(backends): fix vision Ollama tests failing in CI with 400 model …
test(vision): activate Ollama vision e2e via Hugging Face GGUF pull
test(vision): activate Ollama vision e2e via Hugging Face GGUF pull (g…