Problem/Motivation
The isUsable() method in MistralProvider.php incorrectly returns TRUE for the ChatWithImageVision capability even when no API key is configured. This causes Mistral to appear as an
available provider option in the AI settings UI (/admin/config/ai/settings) under "Chat with Image Vision" when it shouldn't be selectable.
Steps to reproduce
1. Install ai_provider_mistral module
2. Do NOT configure an API key at /admin/config/ai/providers/mistral
3. Go to /admin/config/ai/settings
4. Observe that "Mistral AI" appears in the "Chat with Image Vision" provider dropdown
5. Other capabilities correctly show no Mistral option available
Proposed resolution
Move the API key check before the capability checks
Also note: the comment says "No vision support" but the code returns TRUE, which is contradictory. Since beta3 added vision support (#3515048), the comment should be updated/removed.
Issue fork ai_provider_mistral-3571491
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
petar_basic commentedMoved the API key check before the capability checks
Comment #4
petar_basic commentedComment #6
fagothx, straight-forward fix. Merged!