Repository navigation
feat: Vision Support with Pixtral Models and Clipboard Integration - #22724
Conversation
This update introduces full vision capabilities to the extension through Pixtral 12B and Pixtral Large models, with intelligent model switching that automatically upgrades to vision-capable models when images are detected. Since Mistral's TypeScript SDK doesn't yet support vision APIs, this implementation uses direct REST API integration with a custom SSE stream parser. The system automatically converts HEIC/HEIF images (common from iPhone screenshots) to JPEG using macOS's native sips command for seamless compatibility. The UI has been redesigned from Form to List view to support real-time image previews in the detail panel alongside the Mistral logo. Users can now browse their clipboard history (Cmd+Shift+I) to quickly select from the last 5 items, with smart discrimination between images (showing thumbnails) and text (showing 100-character previews). Selecting an image automatically attaches it to the query, while selecting text pastes it into the question field. Quick Look support (Cmd+Y) enables full-screen image verification before submission. Performance improvements include character-based streaming (100-char chunks) that significantly reduces UI jitter during response rendering. This vision integration streamlines the workflow by eliminating the need to manually switch models or leave Raycast to attach images, making visual analysis with Mistral AI as frictionless as text queries.
|
Thank you for your contribution! 🎉 🔔 @colinlienard you might want to have a look. You can use this guide to learn how to check out the Pull Request locally in order to test it. You can expect an initial review within five business days. |
01679d6 to
9e43700
Compare
9e43700 to
afc061b
Compare
…nent Created useClipboardHistory hook and ClipboardSelector component to eliminate code duplication between ask.tsx and conversation.tsx. Added visual feedback for attached images in conversations with search bar indicator and Clear Image action.
left a comment
•
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This PR introduces comprehensive vision capabilities to the Mistral extension by integrating Pixtral 12B and Pixtral Large models. The update completely redesigns the UI from Form to List view to support real-time image previews, adds intelligent model switching that automatically upgrades to vision-capable models when images are detected, and implements clipboard integration for browsing recent images and text. Since Mistral's TypeScript SDK doesn't support vision APIs, the implementation uses direct REST API calls with a custom SSE stream parser. The system includes automatic HEIC/HEIF to JPEG conversion using macOS's native sips command and provides Quick Look support for image verification.
PR Description Notes:
- The changelog entry uses an actual date (2025-11-07) instead of the required template string
{PR_MERGE_DATE}
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
extensions/mistral/src/hooks/use-conversations.ts |
5/5 | Added optional images field to chat type for vision support |
extensions/mistral/CHANGELOG.md |
4/5 | Added comprehensive vision support changelog entry with incorrect date format |
extensions/mistral/package.json |
5/5 | Added Pixtral vision models to user preferences dropdown |
extensions/mistral/src/utils/models.ts |
5/5 | Added vision capability detection and new Pixtral model definitions |
extensions/mistral/src/hooks/use-clipboard-history.ts |
4/5 | New hook for clipboard history with image/text discrimination |
extensions/mistral/src/components/conversation.tsx |
3/5 | Major refactor adding vision API integration and image processing |
extensions/mistral/src/components/clipboard-selector.tsx |
4/5 | New component for clipboard item selection with keyboard shortcuts |
extensions/mistral/src/ask.tsx |
3/5 | Complete UI redesign from Form to List with image preview capabilities |
Confidence score: 3/5
- This PR requires careful review due to platform-specific dependencies and potential runtime errors
- Score lowered due to missing Clipboard import in conversation.tsx, macOS-specific
sipscommand usage that will fail on other platforms, automatic model switching that overrides user preferences, and synchronous file operations in the main thread that could cause performance issues - Pay close attention to
extensions/mistral/src/components/conversation.tsxandextensions/mistral/src/ask.tsxfor file system operations and error handling
Additional Comments (2)
-
extensions/mistral/src/components/conversation.tsx, line 72-78 (link)syntax: Missing import for
Clipboardfrom@raycast/api- these functions will throw runtime errors -
extensions/mistral/src/components/conversation.tsx, line 267 (link)logic: The
newChatobject doesn't include theimagesproperty, which might cause inconsistencies in conversation history with vision-enabled chats.
8 files reviewed, 3 comments
commented
Nov 7, 2025
|
Hi @koalazub👋 Thanks for your contribution 🔥 Do you need help fixing the CI errors mentioned here @colinlienard do you want to check this? |
c8e7711 to
ff50239
Compare
commented
Nov 7, 2025
Hey @pernielsentikaer appreciate that. I think I've sorted it out. I just wanted to know how to trigger reptile again to check greptile again to verify the correctness if possible? |
…only Changed clipboard history logic to only treat files without extensions as images if they match the macOS clipboard pattern (path contains "/Image "). This prevents false positives where arbitrary extensionless files would be incorrectly treated as images. Also added missing Clipboard import and images property to conversation history.
ff50239 to
ed41f1c
Compare
left a comment
There was a problem hiding this comment.
Greptile Overview
Greptile Summary
This review covers only the changes made since the last review, not the entire PR. The recent changes are minor refinements to the vision support implementation: fixing title case consistency in the clipboard selector UI by changing "No items in clipboard history" to "No Items in Clipboard History", and adding specific logic to detect macOS clipboard images that lack file extensions. The macOS clipboard image detection addresses a system-specific behavior where screenshots are stored in clipboard with paths containing "/Image " but no file extension. These changes complement the broader vision capabilities already implemented with Pixtral models and clipboard integration.
Important Files Changed
| Filename | Score | Overview |
|---|---|---|
| extensions/mistral/src/components/clipboard-selector.tsx | 5/5 | Minor UI text capitalization fix for better consistency |
| extensions/mistral/src/hooks/use-clipboard-history.ts | 4/5 | Added clipboard history functionality with macOS image detection logic |
| extensions/mistral/src/components/conversation.tsx | 4/5 | Implemented vision support with image handling and SSE streaming |
Confidence score: 4/5
- This PR requires careful review due to complex image handling logic and potential edge cases in file type detection
- Score reflects thorough implementation of vision features but deducted due to the previous concern about files without extensions being treated as images, and potential issues with the HEIC/HEIF conversion logic that assumes empty extensions indicate convertible image formats
- Pay close attention to the image detection logic in use-clipboard-history.ts and the file extension handling in conversation.tsx, particularly around the empty string extension handling
3 files reviewed, 1 comment
commented
Nov 7, 2025
|
You have the greptile review now @koalazub - do you want a full one too? |
Created shared image-formats.ts module with typed constants for supported formats (JPEG, PNG, WebP) and formats requiring conversion (HEIC/HEIF). Removed unsupported formats (SVG, JXL) that don't render in Raycast markdown. Updated CHANGELOG to reflect all vision support changes including clipboard refactoring and format support.
394471b to
aed238e
Compare
commented
Nov 8, 2025
All good! I think I've managed to structure and address the main points. |
commented
Nov 11, 2025
|
@pernielsentikaer this is now ready |
commented
Nov 12, 2025
|
Published to the Raycast Store: |
commented
Nov 12, 2025
|
🎉 🎉 🎉 We've rewarded your Raycast account with some credits. You will soon be able to exchange them for some swag. |
This update introduces full vision capabilities to the extension through Pixtral 12B and Pixtral Large models, with intelligent model switching that automatically upgrades to vision-capable models when images are detected. Since Mistral's TypeScript SDK doesn't yet support vision APIs, this implementation uses direct REST API integration with a custom SSE stream parser. The system automatically converts HEIC/HEIF images (common from iPhone screenshots) to JPEG using macOS's native sips command.
The UI has been redesigned from Form to List view to support real-time image previews in the detail panel alongside the Mistral logo. Users can now browse their clipboard history (Cmd+Shift+I) to quickly select from the last 5 items, with smart discrimination between images (showing thumbnails) and text (showing 100-character previews). Selecting an image automatically attaches it to the query, while selecting text pastes it into the question field. Quick Look support (Cmd+Y) enables full-screen image verification before submission.
Performance improvements include character-based streaming (100-char chunks) that reduces UI jitter during response rendering. Although I still wasn't able to fix the jitteriness here. If someone has an idea on how to fix this, I'm all ears because React isn't my strong suit here.
This vision integration streamlines the workflow by eliminating the need to manually switch models or leave Raycast to attach images, making visual analysis with Mistral AI more frictionless.
pixtral_vision.mov
Screen.Recording.2025-11-07.at.22.12.20.mov
Conversations continuing with the ability to add images too: