When switching between multimodal models and non-multimodal models, the agent's file upload parameters are incorrect #15708

Closed
opened 2026-02-21 19:23:00 -05:00 by yindo · 3 comments
Owner

Originally created by @zhaobingshuang on GitHub (Jul 27, 2025).

Originally assigned to: @zk2k2 on GitHub.

Self Checks

  • I have read the Contributing Guide and Language Policy.
  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report, otherwise it will be closed.
  • 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.7.0

Cloud or Self Hosted

Cloud

Steps to reproduce

Image Create an agent and select a multimodal model, such as Gemini 2.0 Flash Exp, and turn on the three switches on the left side, Publish Update. Image The value of file_upload.allowed_file_types is ["document", "audio", "image", "video"]. Image

Switch the model to the non-multimodal model GPT-4, and click Publish Update.
Although the switch on the left has disappeared, the value of "file_upload.allowed_file_types" is still ["document", "audio", "image", "video"].

✔️ Expected Behavior

When the switch on the left disappears, the value of "file_upload.allowed_file_types" should be automatically corrected.

Actual Behavior

No response

Originally created by @zhaobingshuang on GitHub (Jul 27, 2025). Originally assigned to: @zk2k2 on GitHub. ### Self Checks - [x] I have read the [Contributing Guide](https://github.com/langgenius/dify/blob/main/CONTRIBUTING.md) and [Language Policy](https://github.com/langgenius/dify/issues/1542). - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report, otherwise it will be closed. - [x] 【中文用户 & Non English User】请使用英语提交,否则会被关闭 :) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.7.0 ### Cloud or Self Hosted Cloud ### Steps to reproduce <img width="1393" height="1133" alt="Image" src="https://github.com/user-attachments/assets/f9363e64-b663-485c-8da3-b1d16020455a" /> Create an agent and select a multimodal model, such as Gemini 2.0 Flash Exp, and turn on the three switches on the left side, Publish Update. <img width="1176" height="515" alt="Image" src="https://github.com/user-attachments/assets/bc34ce1a-5e8e-4667-8b1f-dcd2dabf235a" /> The value of file_upload.allowed_file_types is ["document", "audio", "image", "video"]. <img width="2559" height="928" alt="Image" src="https://github.com/user-attachments/assets/3b8e3744-3759-4c46-bc83-2a4c5e6862df" /> Switch the model to the non-multimodal model GPT-4, and click Publish Update. Although the switch on the left has disappeared, the value of "file_upload.allowed_file_types" is still ["document", "audio", "image", "video"]. ### ✔️ Expected Behavior When the switch on the left disappears, the value of "file_upload.allowed_file_types" should be automatically corrected. ### ❌ Actual Behavior _No response_
yindo added the good first issue label 2026-02-21 19:23:00 -05:00
yindo closed this issue 2026-02-21 19:23:00 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Jul 27, 2025):

This is a known issue: when switching from a multimodal to a non-multimodal model, the UI hides the file type switches but does not automatically reset the file_upload.allowed_file_types parameter. This happens because the frontend manages this parameter and currently lacks logic to clean up unsupported file types when the model changes. The backend does not enforce or recalculate this either, so stale values can persist in your config, as you observed.

There is no built-in workaround to automatically fix this after switching models. As a temporary manual fix, you can toggle the file upload switches (if visible) to remove unsupported types, or edit the configuration directly if possible.

For a robust solution, the code should be updated so that when the model changes, the allowed file types are reset to match the new model's capabilities. The best place to add this logic is in the model switching handler (such as the setModel function in the main configuration component or the onChange handler in the model picker), immediately after a model switch. This would ensure the UI and config always stay in sync with the selected model's features. See the relevant code and explanation here and here.

Until this is fixed, avoid switching from multimodal to non-multimodal models if you need the file upload config to be accurate, or manually clear the unsupported types after switching.

To reply, just mention @dosu.


How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other  Chat with Dosu Join Discord Share on X

@dosubot[bot] commented on GitHub (Jul 27, 2025): <!-- Answer --> This is a known issue: when switching from a multimodal to a non-multimodal model, the UI hides the file type switches but does not automatically reset the `file_upload.allowed_file_types` parameter. This happens because the frontend manages this parameter and currently lacks logic to clean up unsupported file types when the model changes. The backend does not enforce or recalculate this either, so stale values can persist in your config, as you observed. There is no built-in workaround to automatically fix this after switching models. As a temporary manual fix, you can toggle the file upload switches (if visible) to remove unsupported types, or edit the configuration directly if possible. For a robust solution, the code should be updated so that when the model changes, the allowed file types are reset to match the new model's capabilities. The best place to add this logic is in the model switching handler (such as the `setModel` function in the main configuration component or the `onChange` handler in the model picker), immediately after a model switch. This would ensure the UI and config always stay in sync with the selected model's features. See the relevant code and explanation [here](https://github.com/langgenius/dify/blob/bd5b9385719e642cad37c32e725ca8846b8d192d/web/app/components/app/configuration/index.tsx) and [here](https://github.com/langgenius/dify/blob/bd5b9385719e642cad37c32e725ca8846b8d192d/web/app/components/app/configuration/config/assistant-type-picker/index.tsx). Until this is fixed, avoid switching from multimodal to non-multimodal models if you need the file upload config to be accurate, or manually clear the unsupported types after switching. <!-- Dosu Comment Footer --> *To reply, just mention [@dosu](https://go.dosu.dev/dosubot).* --- <sup>How did I do? [Good](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=great_response) | [Irrelevant](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=irrelevant_answer) | [Incorrect](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=incorrect_sources) | [Verbose](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=hallucination) | [Report 🐛](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/dfb3a41d-ef84-4379-a36e-ee9038be56f3?feedback_type=other)</sup>&nbsp;&nbsp;[![Chat with Dosu](https://dosu.dev/dosu-chat-badge.svg)](https://app.dosu.dev/6088a4f4-073a-43f3-b3d4-4f06fb0c05a0/ask?utm_source=github)&nbsp;[![Join Discord](https://img.shields.io/badge/join-5865F2?logo=discord&logoColor=white&label=)](https://go.dosu.dev/discord-bot)&nbsp;[![Share on X](https://img.shields.io/badge/X-share-black)](https://twitter.com/intent/tweet?text=%40dosu_ai%20helped%20me%20solve%20this%20issue!&url=https%3A//github.com/langgenius/dify/issues/23030)
Author
Owner

@zk2k2 commented on GitHub (Jul 28, 2025):

Hi can you please assign me this? I would like to contribute, thanks!

@zk2k2 commented on GitHub (Jul 28, 2025): Hi can you please assign me this? I would like to contribute, thanks!
Author
Owner

@zhaobingshuang commented on GitHub (Jul 28, 2025):

Hi can you please assign me this? I would like to contribute, thanks!

@crazywoola Please assign issue to zk2k2

@zhaobingshuang commented on GitHub (Jul 28, 2025): > Hi can you please assign me this? I would like to contribute, thanks! @crazywoola Please assign issue to zk2k2
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#15708