Commit 701bc31
authored
fix(read_file): return image bytes in MCP content so the model can see images (#488)
read_file on an image previously put the image bytes only in
structuredContent (for the preview widget) and sent the host model a
text-only summary ("Image file: ... (image/png)"). The model received
no image block, so reading an image was effectively a no-op for the
model — it could never actually see the image.
Add the image content block back into the `content` array while keeping
structuredContent unchanged, so:
- the host model receives the image and can analyze it
- the preview widget still renders from structuredContent as before
The previous "text-only for broad host compatibility" approach blinded
every host that can handle images, which is the common case.1 parent 673111c commit 701bc31
1 file changed
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
147 | 147 | | |
148 | 148 | | |
149 | 149 | | |
150 | | - | |
151 | | - | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
152 | 153 | | |
153 | 154 | | |
154 | 155 | | |
| |||
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
161 | 167 | | |
162 | 168 | | |
163 | 169 | | |
| |||
0 commit comments