Title: DeepSeek API 不支持 image_url 消息类型导致 400 错误 · Issue #50 · lessweb/deepcode-cli · GitHub
Open Graph Title: DeepSeek API 不支持 image_url 消息类型导致 400 错误 · Issue #50 · lessweb/deepcode-cli
X Title: DeepSeek API 不支持 image_url 消息类型导致 400 错误 · Issue #50 · lessweb/deepcode-cli
Description: 问题描述 当消息中包含图片时(粘贴剪贴板图片、Read 工具读取图片文件),deepcode-cli 会将图片以 image_url 类型附加到消息 content 中。但 DeepSeek API 只接受 text 类型内容,导致报错: Request failed: 400 Failed to deserialize the JSON body into the target type: messages[58]: unknown variant image_url...
Open Graph Description: 问题描述 当消息中包含图片时(粘贴剪贴板图片、Read 工具读取图片文件),deepcode-cli 会将图片以 image_url 类型附加到消息 content 中。但 DeepSeek API 只接受 text 类型内容,导致报错: Request failed: 400 Failed to deserialize the JSON body into the target type:...
X Description: 问题描述 当消息中包含图片时(粘贴剪贴板图片、Read 工具读取图片文件),deepcode-cli 会将图片以 image_url 类型附加到消息 content 中。但 DeepSeek API 只接受 text 类型内容,导致报错: Request failed: 400 Failed to deserialize the JSON body into the target type:...
Opengraph URL: https://github.com/lessweb/deepcode-cli/issues/50
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"DeepSeek API 不支持 image_url 消息类型导致 400 错误","articleBody":"## 问题描述\n\n当消息中包含图片时(粘贴剪贴板图片、Read 工具读取图片文件),deepcode-cli 会将图片以 `image_url` 类型附加到消息 content 中。但 DeepSeek API 只接受 `text` 类型内容,导致报错:\n\n```\nRequest failed: 400 Failed to deserialize the JSON body into the target type: messages[58]: unknown variant image_url\n```\n\n## 相关代码\n\n- `src/session.ts` — `buildUserMessage()` 第 1454-1460 行,将 `prompt.imageUrls` 转为 `image_url` 类型\n- `src/tools/read-handler.ts` — Read 图片处理 第 499-503 行,读取图片后附加 `image_url`\n- `src/ui/App.tsx` — `buildSyntheticUserMessage()` 第 467-472 行,剪贴板粘贴图片构建 `image_url`\n\n## 复现步骤\n\n1. 启动 deepcode-cli\n2. Ctrl+V 粘贴一张图片\n3. 发送消息\n4. 报 400 错误\n\n## 环境\n\n- deepcode-cli 版本:0.1.19\n- 模型:deepseek-v4-pro","author":{"url":"https://github.com/dengmik-commits","@type":"Person","name":"dengmik-commits"},"datePublished":"2026-05-13T06:51:34.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":3},"url":"https://github.com/50/deepcode-cli/issues/50"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:e3ec50a2-1676-a239-64f2-88403f9ff754 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E2DC:3CB688:12F4156:1A352CD:6A4DE853 |
| html-safe-nonce | b768f0ac8e2526d8428208114d9d52f1b5518f52746ed4cd97239f7e8c0f4d5e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMkRDOjNDQjY4ODoxMkY0MTU2OjFBMzUyQ0Q6NkE0REU4NTMiLCJ2aXNpdG9yX2lkIjoiOTAyNTU2MTk4NTQ3MTYwNDgyMCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | d3447e45fe0491985b0ffe5961298ec76d0574798b378dba5b3e1fcfbb9c072f |
| hovercard-subject-tag | issue:4435587791 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/lessweb/deepcode-cli/50/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4dfffcf99c26a366cde096174251ab9add1f4bfb216aab27b30db5b9cf97ce9a/lessweb/deepcode-cli/issues/50 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4dfffcf99c26a366cde096174251ab9add1f4bfb216aab27b30db5b9cf97ce9a/lessweb/deepcode-cli/issues/50 |
| og:image:alt | 问题描述 当消息中包含图片时(粘贴剪贴板图片、Read 工具读取图片文件),deepcode-cli 会将图片以 image_url 类型附加到消息 content 中。但 DeepSeek API 只接受 text 类型内容,导致报错: Request failed: 400 Failed to deserialize the JSON body into the target type:... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dengmik-commits |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/lessweb/deepcode-cli git https://github.com/lessweb/deepcode-cli.git |
| octolytics-dimension-user_id | 118287711 |
| octolytics-dimension-user_login | lessweb |
| octolytics-dimension-repository_id | 1223512305 |
| octolytics-dimension-repository_nwo | lessweb/deepcode-cli |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1223512305 |
| octolytics-dimension-repository_network_root_nwo | lessweb/deepcode-cli |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | canary-1 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width