feat(vision): add deepseek-v4-flash-vision-exp native image input (#242) - #243
Conversation
…zards#242) Add support for deepseek-v4-flash-vision-exp with native image+text content blocks, while keeping the existing vision-proxy flow for non-native models. Dependency Changes: - package.json dependencies/devDependencies: no direct version changes - package-lock.json: transitive lockfile resolution updated (includes refreshed versions/resolved sources for several packages) Closes Vizards#242
There was a problem hiding this comment.
Pull request overview
This PR adds a new experimental model deepseek-v4-flash-vision-exp that supports native multimodal (image + text) input, addressing issue #242. Instead of routing images through the existing vision-proxy pipeline, native-vision models send OpenAI-style content blocks (text parts and image_url data URLs) directly to the DeepSeek API. To support this, DeepSeekMessage.content is broadened from string to string | DeepSeekContentPart[], and the diagnostics/dump/classifier code paths that assumed a string are updated to extract text from the new array shape. The model is registered in the model registry, config schema, i18n, and README.
Changes:
- Register
deepseek-v4-flash-vision-expwith anativeImageInputcapability, and build nativecontentblocks inconvertMessageswhile bypassing the vision proxy inprepareChatRequest. - Broaden
DeepSeekMessage.contentto allow content-part arrays, and update classifier/dump/diagnostics/error-char counting to handle both string and array content. - Update i18n, README (both locales),
package.json, and NLS config for the new model; refreshpackage-lock.jsontransitive dev dependencies.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/types.ts | Adds content-part types and nativeImageInput capability flag |
| src/consts.ts | Registers the new native-vision model |
| src/provider/convert.ts | Builds native text/image content blocks for user messages |
| src/provider/request.ts | Bypasses vision proxy for native models; import block re-indented with spaces |
| src/provider/routing/classifier.ts | Extracts text from array content |
| src/provider/debug/dump.ts | Adds getDeepSeekMessageText helper for content extraction |
| src/provider/debug/diagnostics.ts | Adds toDiagnosticContentText; import block re-indented with spaces |
| src/client/error/index.ts | Counts chars across string/array content; import block re-indented with spaces |
| src/i18n.ts, package.nls*.json, package.json | Adds strings/config for the new model |
| README.md, README.zh-cn.md | Documents the new model |
| package-lock.json | Transitive dev-dependency lockfile refresh |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…rsion, and adjusted the version number to 0.7.2
|
Hi @demo-zexuan — thank you for responding to this request and putting together a working implementation so quickly! I’ve decided to use this PR as the foundation for adding native vision support. To keep this PR focused and complete, please limit its scope to the new Vision Exp model and the existing user-attachment vision flow. I may follow up with a stacked PR for images returned by agent tools, so there is no need to handle tool-result images in this PR. Before the next review, could you please make the following changes? 1. Static checks and formattingThe approved CI workflow is currently failing at
npm run lint
npm run format:check
npm run compile2. Existing Copilot reviewThank you for following up on the Copilot review comments. The shared content helper introduced in Please review each Copilot comment individually. After the requested change has been implemented and verified, reply where useful and mark the corresponding review thread as Resolved. If a suggestion is not applicable or should not be implemented, briefly explain the reason in the thread before resolving it. Please do not mark a thread as resolved before the underlying issue has actually been addressed. Some formatting threads are already marked as resolved, but the latest CI result still reports formatting problems, including in Once these changes are ready, I plan to run an Agent Peer Review over the complete implementation. There may be additional review feedback at that point, and I’d appreciate your help making any necessary adjustments and resolving the corresponding review threads after they are addressed. 3. Make Vision Exp the default vision route for Flash and ProFor image requests made through DeepSeek V4 Flash or Pro, please replace The intended behavior is:
The current vision-model filtering excludes the entire Please also include Vision Exp in the vision-model selector. In automatic mode, selection should require an exact Vision Exp match; avoid falling back to 4. Keep image token estimation conservativeThe current implementation includes the full base64 image URL length in For this initial implementation, please use a deliberately conservative and simple policy:
I can introduce dimension-aware image token calculation later if it becomes necessary. 5. Report native vision diagnostics accuratelyThe native path currently creates a Please keep this as a small, incremental diagnostics change rather than redesigning the diagnostics system. A suitable approach would be:
Proxy-specific counters can remain unchanged and may be zero when the mode is 6. Repository hygieneNo dependency changes are required for this feature, so please:
7. Manual regression testingBecause of the evolving compatibility matrix across VS Code, GitHub Copilot, and the Language Model API, stable automated regression coverage is difficult for these scenarios. Please perform a best-effort manual regression test using the latest stable VS Code release:
Only the following scenarios need to be covered in this PR:
Please report the result of these two checks in the PR when the implementation is ready. I can perform the remaining compatibility and regression testing afterward. Thanks again for getting the initial native vision path working so quickly. This gives the project a solid foundation to build on. |
…fault Signed-off-by: zexuan.peng <pengzexuan2001@gmail.com>
Signed-off-by: zexuan.peng <pengzexuan2001@gmail.com>
Signed-off-by: zexuan.peng <pengzexuan2001@gmail.com>
Signed-off-by: zexuan.peng <pengzexuan2001@gmail.com>
Vizards
left a comment
There was a problem hiding this comment.
Focused follow-up review against the routing and diagnostics behavior agreed for this PR. The core implementation is close; the inline comments identify the three remaining behavior gaps.
|
Thank you for continuing to work through these follow-up details. If any part of the expected behavior is still unclear—especially the diagnostics sanitization or how its metadata representation should fit into the existing cache-trace logic—please complete the portions you are confident about and let me know once you are done. I can take over the remaining cleanup and final integration from there. There is no need to expand this PR into a broader diagnostics redesign just to resolve that uncertainty. |
|
Always keeping an eye on these two experts and waiting for the update to be available in VSCode.😊 |
There was a problem hiding this comment.
🔵 Needs a closer look
It changes core request-building, token-accounting, and vision-routing logic across many files with no automated test coverage, so final human verification is warranted.
Review details
- Files reviewed: 21/21 changed files
- Comments generated: 0 new
- Review effort level: Balanced
|
@Vizards I have improved it as much as possible. Please take some time to revise and adjust it, thank you 😊 |
|
Thanks again for the quick work and for addressing the review feedback. Everything looks good on my side now, and I'll merge this shortly. |









Summary
Dependency Changes
Testing
Test Case: Identify and solve a linear algebra problem:
Closes #242