Tag models with vision capabilities and describe images for text-only models - #4114
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
🔍 Code Review Summary (Codex)Verdict: ⛔ NO - Do NOT merge Issues Summary
The fallback selects the first configured vision provider and sends the user's image to it, even when that provider differs from the model/provider the user selected. This silently expands disclosure of potentially sensitive screenshots or project assets to an additional third party without consent or an explicit setting. The product needs an approved privacy boundary (for example, opt-in consent with the destination disclosed, or fallback restricted to the selected provider) before performing this upload. Generated by Codex |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a7b0a7075d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
There was a problem hiding this comment.
All reported issues were addressed across 17 files
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
🔍 Dyadbot Code Review SummaryVerdict: 🤔 NOT SURE - Potential issues This PR tags models with vision capabilities and adds a robust text-description fallback for text-only models. The mechanism is sound and unusually well-tested (unit + integration + fake-catalog E2E). The four load-bearing correctness concerns I checked all hold up: the injected No HIGH-severity issues were found, so nothing blocks merge. The items below are informational MEDIUM/LOW notes. Issues Summary
🟢 Low Priority Notes (4 items)
Note on confidence: the PR branch is not checked out in the working tree, so new-side line numbers for newly added files/blocks were derived from diff hunk headers against the current base files and may be off by a few lines. The verified base-file anchors ( Generated by Dyadbot persona-based code review |
🔍 Code Review Summary (Codex)Verdict: ⛔ NO - Do NOT merge Issues Summary
The new fallback is enabled for every existing and new user, and it may upload image attachments to a provider other than the one selected for the chat. A settings-page hint does not provide consent before the first such upload, so upgrading Dyad can silently expand the set of third parties receiving a user's images. Make the cross-provider fallback opt-in (or obtain explicit consent at first use) before enabling it. Generated by Codex |
cb1a943 to
8e09d20
Compare
🔍 Code Review Summary (Codex)Verdict: 🤔 NOT SURE - Potential issues Issues Summary
The bare Generated by Codex |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
🔍 Code Review Summary (Codex)Verdict: 🤔 NOT SURE - Potential issues Issues Summary
The visible setting does not disclose that fallback can send image attachments to a provider different from the selected chat provider. The capability-error matcher also treats any error containing Generated by Codex |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f857984f5d
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
f857984 to
ec1b117
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ec1b117528
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
🔍 Code Review Summary (Codex)Verdict: 🤔 NOT SURE - Potential issues Issues Summary
The new vision fallback is otherwise well-covered across attachment delivery, replayed history, and mid-turn local-agent injections. Generated by Codex |
🔍 Code Review Summary (Codex)Verdict: 🤔 NOT SURE - Potential issues Issues Summary
The diff is complete, and no HIGH-severity issues were found. Generated by Codex |
29aac07 to
57b6777
Compare
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
🔍 Dyadbot Code Review SummaryVerdict: ✅ YES - Ready to merge This PR tags models with Things I specifically verified and found correct:
The diff was complete (not truncated), which supports high confidence in this assessment. 🟢 Low Priority Notes (3 items)
Generated by Dyadbot persona-based code review |
🎭 Playwright Test Results❌ Some tests failed
Summary: 819 passed, 4 failed, 9 flaky, 292 skipped Failed Tests🍎 macOS
🪟 Windows
📋 Re-run Failing Tests (macOS)Copy and paste to re-run all failing spec files locally: npm run e2e \
e2e-tests/package_manager.spec.ts
|
wwwillchen
left a comment
There was a problem hiding this comment.
@nourzakhama2003 thanks for the PR. we should update our remote language catalog (which is in our private repo) to mark whether vision is supported for a model, before doing this PR.
The one thing I'm not sure about is the quality of getting a textual description of an image. Do you have some examples of descriptions generated using your prompt? in particular, including some examples in the PR description of image inputs and description outputs using gpt-5.6-luna which is a cheap and capable model, would be very helpful in validating whether this approach is effective. thanks
thanks for the review! On the catalog: agreed, that should land first. The code already anticipates it , On description quality: fair concern, that's what decides whether this is worth having. I tested it two ways with 1. End-to-end in DyadChat model: GLM 5.2 (tagged
Asked the text-only model
Full response from GLM 5.2Every value checks out against the source image: the name and email, all six nav items in order, all four KPI figures, the tooltip on the June column, the 2019/2020 legend colors, the 45% donut, the four Lorem ipsum rows, both "Check Now" buttons. Only drift is comma-vs-period decimals ( Then
Log lines from that run: |



Closes #3982
Closes #3774
Summary
Vision fallback for text-only models — Tags models with supportsVision and adds a fallback: when the selected model can't handle images, a vision-capable model (via dyad/vision/default alias) describes them instead, injecting the description as . Gated behind a new enableVisionFallback setting.
Text-only models (GLM 4.7/5/5.2, Qwen3 Coder, DeepSeek, MiniMax M2.5/M2.7, Nemotron) explicitly tagged false; unknown models default to capable.
Image parts stripped from replayed history and mid-turn tool injections (screenshots from web_crawl/run_tests) when the active model is text-only.
Error messages for capability failures translated into actionable text; also fixes a JSON.stringify circular-reference crash and an undefined request-ID bug.
No DB migration needed (settings/model fields only, not schema).
9 test files covering fallback logic, catalog overlay, history stripping, and settings defaults.
Tests
npm test -- src/ipc/utils/vision_fallback.test.ts
npm test -- src/ipc/utils/chat_attachment_utils.test.ts
npm test -- src/ipc/utils/token_utils.test.ts
npm test -- src/ipc/shared/remote_language_model_catalog.test.ts
npm test -- src/ipc/handlers/chat_stream_handlers.test.ts
npm test -- src/pro/main/ipc/handlers/local_agent/local_agent_handler.test.ts
npm test -- src/pro/main/ipc/handlers/local_agent/prepare_step_utils.test.ts
npm test -- src/main/settings.test.ts
npm test -- src/ipc/handlers/tests/vision_fallback.integration.test.tsx