zai-org / zai-org/feedback

粘贴的图片不保存为本地文件:纯文本模型返回 400,且无法用 skill 中的多模态模型分析图片

Open
#244 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

priority: P2
Dominant language
No language data
Stars
22
Forks
1
PR merge metrics
No merged PRs in 30d

Description

环境
  • ZCode 桌面版,Windows 10 x64
  • 模型:deepseek-v4-flash-free(纯文本,无视觉能力)
问题描述

在聊天中粘贴截图后,ZCode 会把图片序列化为 image_url 内容块,直接内联发送给模型。对纯文本模型会直接报错:

Upstream request failed: [invalid_request_error] Failed to deserialize the JSON body into the target type: messages[N]: unknown variant image_url, expected text at line 1 column ...

示例 TraceID:5fa05e15-5793-4d56-babd-f557c573270f

更关键的是:ZCode 不会把粘贴的截图保存为本地临时文件。用户无法通过 skill 调用外部多模态模型(例如 describe-image 技能调用 MiMo-V2.5)来分析截图——因为截图没有落盘、也没有文件路径可以引用,技能脚本找不到图片文件,图片分析无法进行。

此外,粘贴的图片会残留在会话历史中,同一会话的后续每次请求都会重新发送并再次返回 400,整个会话不可用,直到用户手动删除附件。

期望行为

其他编码代理(如 Claude Code)会把粘贴的图片保存到本地临时文件(如会话目录下),并在消息中引用文件路径。agent 可以用文件工具读取该文件,交给视觉模型或辅助脚本(skill)处理。

建议
  1. 将粘贴的图片保存为临时文件,并在提示词中引用文件路径(类似 Claude Code)。
  2. 增加设置项,控制图片处理方式(内联 vs 文件路径)。
  3. 识别纯文本模型并优雅降级(跳过图片块并提示),而不是返回 400 阻塞整个会话。

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the paste-to-chat path described in the issue, then trace how image_url blocks are retained in conversation history and sent to the model. Done means pasted images have a usable local-file path for skills such as describe-image and MiMo-V2.5, while text-only models no longer leave the session blocked by repeated 400 responses.

Written by the indexing model from the issue text.

Assessment

Domain
ai, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.