[PR #15272] [MERGED] app/ui: re-validate image attachments when selected model changes #25639

Closed
opened 2026-04-19 18:19:33 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/ollama/ollama/pull/15272
Author: @matteocelani
Created: 4/3/2026
Status: Merged
Merged: 4/10/2026
Merged by: @hoyyeva

Base: mainHead: fix/file-validation-model-change


📝 Commits (2)

  • 152da07 app/ui: re-validate image attachments when selected model changes
  • 0bc800c app/ui: update file validation test to match new vision check flow

📊 Changes

3 files changed (+33 additions, -19 deletions)

View changed files

📝 app/ui/app/src/components/ChatForm.tsx (+28 -11)
📝 app/ui/app/src/utils/fileValidation.test.ts (+5 -3)
📝 app/ui/app/src/utils/fileValidation.ts (+0 -5)

📄 Description

When uploading an image with a non-vision model selected, the file is permanently rejected and its data discarded. Switching to a vision-capable model still shows the error, forcing the user to remove and re-upload the file.

This moves the vision capability check from upload-time rejection to render-time derived state. Images are always accepted as attachments, and a warning is shown when the current model does not support them. The warning clears automatically when switching to a vision model. At submit time, unsupported images are filtered out to preserve the existing behavior of not sending images to non-vision models.

Changes:

  • fileValidation.ts: remove the vision capability check that rejected images at upload time
  • ChatForm.tsx: show a derived warning on image attachments when the model lacks vision capability, and filter unsupported images at submit time

Fixes #12952


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/ollama/ollama/pull/15272 **Author:** [@matteocelani](https://github.com/matteocelani) **Created:** 4/3/2026 **Status:** ✅ Merged **Merged:** 4/10/2026 **Merged by:** [@hoyyeva](https://github.com/hoyyeva) **Base:** `main` ← **Head:** `fix/file-validation-model-change` --- ### 📝 Commits (2) - [`152da07`](https://github.com/ollama/ollama/commit/152da07b85bbf230c1ec357e2ba7c8d3c0562465) app/ui: re-validate image attachments when selected model changes - [`0bc800c`](https://github.com/ollama/ollama/commit/0bc800cfca4522bbea20be08452e5e3ee4e7e1ce) app/ui: update file validation test to match new vision check flow ### 📊 Changes **3 files changed** (+33 additions, -19 deletions) <details> <summary>View changed files</summary> 📝 `app/ui/app/src/components/ChatForm.tsx` (+28 -11) 📝 `app/ui/app/src/utils/fileValidation.test.ts` (+5 -3) 📝 `app/ui/app/src/utils/fileValidation.ts` (+0 -5) </details> ### 📄 Description When uploading an image with a non-vision model selected, the file is permanently rejected and its data discarded. Switching to a vision-capable model still shows the error, forcing the user to remove and re-upload the file. This moves the vision capability check from upload-time rejection to render-time derived state. Images are always accepted as attachments, and a warning is shown when the current model does not support them. The warning clears automatically when switching to a vision model. At submit time, unsupported images are filtered out to preserve the existing behavior of not sending images to non-vision models. Changes: - `fileValidation.ts`: remove the vision capability check that rejected images at upload time - `ChatForm.tsx`: show a derived warning on image attachments when the model lacks vision capability, and filter unsupported images at submit time Fixes #12952 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-19 18:19:33 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#25639