makecindy / makecindy/cindy

Claude Code 使用视觉模型时,Read 工具返回的本地图片静默为空

Open
#2,416 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
2.7k
Forks
401
Avg merge
21h 48m
Merged PRs (30d)
776

Description

**客户端版本**: 0.1.44
**反馈类型**: bug

---

## 现象

在 Cindy 的 Claude Code runtime 中使用 `codex/gpt-5.6-sol` 模型时,直接作为聊天附件发送的图片可以被模型识别;但让 Agent 通过 `Read` 工具读取同一张本地图片时,工具调用正常结束,模型却没有获得可用的视觉内容,也没有任何错误或“不支持图片”的提示。

这是同一文件、同一会话、同一模型下的 A/B 对照,区别仅在图片进入路径:消息附件可见,`Read` tool result 为空。

## 复现步骤

1. 在 Cindy 中使用 Claude Code runtime,模型选择 `codex/gpt-5.6-sol`。
2. 将一张 PNG 直接作为聊天附件发送,让模型描述画面,确认模型能够读取图片。
3. 在同一会话中,让 Agent 使用 `Read` 工具读取该图片对应的本地文件。
4. 观察:`Read` 调用正常结束,但模型无法获得图片视觉内容,也没有收到不支持或传输失败提示。
5. 可使用独立生成、已验证像素非空的 PNG 重复测试,结果一致。

## 期望行为

1. 对同一个具备视觉输入能力的模型,`Read` 工具返回的本地图片应与消息附件一样可见。
2. 如果当前 runtime、模型路由或 provider 不支持 tool result 中的图片,应明确阻断并提示原因,而不是静默返回空视觉结果。
3. 建议诊断信息能够区分消息附件、`Read` 工具图片、浏览器截图及其他 tool-result 图片的传输路径。

## 实际行为

- 消息附件路径:模型能准确描述图片内容。
- 对同一个本地 PNG 调用 `Read`:工具无报错结束,但模型收不到可用视觉内容。
- 模型只能将其判断为空结果;系统没有暴露图片在哪一层被丢弃。

## 复现频率

当前会话中重复复现。除同文件 A/B 对照外,以下本地图片经 `Read` 均得到空视觉结果:

- 已验证像素非空的视频单帧 PNG;
- 视频联系表 JPG;
- 独立生成的蓝底、黄色矩形、红色矩形控制图 PNG。

## 已尝试

- 确认图片文件格式有效且可以正常打开。
- 通过像素统计确认视频帧不是空白图。
- 使用完全独立生成的简单几何图排除视频解码、HDR、图片复杂度等因素。
- 用消息附件与 `Read` 读取同一个 PNG 做对照,前者可见、后者为空。
- 检索现有 Issue:#794 是 Claude Code + 明确不支持视觉的纯文本模型;#1326、#593、#2371 是用户附图或 Chat bridge 路径。它们与本次“同一视觉模型下,消息附件正常而 `Read` tool result 静默为空”的边界不同。

## 可能的排查边界

请检查:

- Cindy 是否将 `Read` 的 image block 正确包装并交给 Claude Code runtime;
- Claude Code runtime 使用非 Claude 视觉模型路由时,是否保留 tool result 中的图片块;
- provider/bridge 是否静默丢弃 tool-result 图片;
- 图片被丢弃时为何没有能力门控、错误或可操作提示。
---
**版本区域**: CN
**OS**: darwin x64 (24.6.0)
**界面语言**: zh-CN

Contributor guide

Open the contributing guide

Research direction

Trace the Read tool's image block through Cindy's Claude Code runtime and the provider or bridge path, comparing it with the working message-attachment path. Reproduce with the same PNG and model, then confirm that the image reaches the model or that an explicit unsupported-path error is returned instead of a silent empty result.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
ai, backend-api-design
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.