Skip to content

[tongyi] _is_vision_model always returns False due to unconditional variable override #3006

@zjiongyu

Description

@zjiongyu

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues Dify issues & Dify Official Plugins, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.13.3

Plugin version

0.1.41

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

  1. Configure a model (e.g., multimodal-embedding-v1) that has a valid YAML configuration file in its directory.
  2. The YAML file contains valid definitions, specifically including 'features': ['vision'].
  3. Trigger the logic that calls the _is_vision_model method to check if the model supports vision features.
  4. Observe the console output and the returned value.

✔️ Error log

The method always returns False for vision models, completely ignoring the actual content of the YAML file.

This is caused by a logic flaw in the _is_vision_model method. When the YAML file is successfully parsed and the if condition for 'vision' is met, it correctly sets vision_models[model] = True. However, the code execution continues out of the try...except block, where an unconditional vision_models[model] = False overwrites the previously assigned True value.

As a result, any model with a valid YAML configuration is falsely flagged as not having vision capabilities, which breaks downstream multimodal features.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions