feat(vision-bridge): 纯文本模型视觉桥(层 A/B/C/D + 设置 UI + 用户提示) - #2543
Conversation
|
| Filename | Overview |
|---|---|
| packages/maker-core/src/session.ts | send 与 steer 共用视觉转换,并在异步转换后校验 turn 生命周期;既有相关问题已修复或被明确接受。 |
| apps/desktop/src/main/mcp-integrations/ghost.ts | Ghost 工具结果图片描述采用深度和节点双重预算,当前修复可约束新增同步扫描。 |
| apps/desktop/src/main/vision-bridge/vision-bridge.ts | 实现目标模型判断、图片描述调度、并发限制、缓存和主备后端回退。 |
| apps/desktop/src/main/maker-host/provider-route.ts | 为视觉请求复用 provider 路由、模型改写和鉴权头策略,并覆盖 XD bridge 与 legacy 凭证形态。 |
| packages/anthropic-compat-proxy/src/vision-bridge-transform.ts | 在 Anthropic Messages 与 OpenAI Responses 请求中将目标模型的图片块替换为描述文本。 |
| apps/desktop/src/renderer/components/settings/VisionBridgeSection.tsx | 新增视觉桥开关、目标模型和主备后端设置界面,并接入国际化文案。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart LR
U[用户或工具产生图片] --> S{入口}
S -->|Session send / steer| B[层 B 会话视觉桥]
S -->|代理请求| A[层 A 透明转换]
S -->|Pi 工具| C[层 C vision 工具]
S -->|Ghost 工具结果| D[层 D 媒体描述]
B --> R[视觉后端路由]
A --> R
C --> R
D --> R
R --> P[主视觉后端]
P -->|失败| F[备用视觉后端]
P -->|成功| T[文字描述]
F -->|成功| T
F -->|不可用| N[文字占位与用户提示]
Reviews (22): Last reviewed commit: "feat(vision-bridge): 纯文本模型视觉桥(层 A/B/C/D ..." | Re-trigger Greptile
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 64c5947999
ℹ️ 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".
|
@yan-xdt 👋 这个 PR 还有 4 条 review conversation 没 resolve(apps/desktop/src/main/mcp-integrations/ghost.ts / packages/maker-core/src/session.ts / apps/desktop/src/main/vision-bridge/vision-channel.ts),auto-review 因此暂时跳过、没法继续审查 / 合并。 如果你已经按评论改完或回应了,请到对应 thread 上点 Resolve conversation;全部 resolve 后,下一轮 auto-review 会自动重新审查这个 PR。 |
维护者确认本 PR 触发了维护者确认门:
请维护者审查功能方向和插件兼容性后 Approve 或 Request Changes。详见讨论 issue。 讨论 issue:#2544 |
64c5947 to
405e2f1
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 405e2f1048
ℹ️ 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".
405e2f1 to
d540f3d
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d540f3d6b4
ℹ️ 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".
d540f3d to
1947616
Compare
1947616 to
9994c8c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9994c8cd8e
ℹ️ 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".
1f9de67 to
3f221bc
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f221bc3a1
ℹ️ 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".
3f221bc to
ba2640b
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ba2640b952
ℹ️ 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".
ba2640b to
861b81a
Compare
033b4bf to
5c46075
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5c460754b2
ℹ️ 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".
5c46075 to
569ce0e
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 569ce0e3a6
ℹ️ 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".
569ce0e to
1ac2346
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 1ac23461cb
ℹ️ 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".
1ac2346 to
7dfe2cc
Compare
MagicLizi
left a comment
There was a problem hiding this comment.
自动审查发现 4 个 P1
-
[P1]
docs/vision-bridge-design.md:241,246-250vsapps/desktop/src/main/vision-bridge/vision-bridge.ts:449-463vsapps/desktop/src/main/maker-host/index.ts:699— 全失败语义三方不一致。
设计文档自述「本文件是实现的唯一锚点」,其 §5.3 表格写明全部图失败时「回退无视觉桥状态…图原样透传」;但实现层 B 在!anySucceeded时把全部 image block 替换为IMAGE_UNAVAILABLE_TEXT占位文本;同时 main 侧广播文案写「已按原样处理」,而 hook note 与 zh-CN i18n 写「已以文字提示代替」。文档、代码、文案三处互相矛盾,且占位替换语义(真实行为)未回写锚点文档。请把设计文档 §5.3 更新为占位替换语义,并统一 index.ts:699 广播文案。 -
[P1] 提交前测试门禁(硬性要求)未满足。 PR 描述自认「全量
pnpm test:unit:按开发者指示未执行」。59 文件、约 7.6k 行跨 maker-core/proxy/main/renderer 改动,规则明确「提交前都必须在本地跑完仓库根 pnpm test:unit…任何一项失败都不得提交」(唯一豁免是防丢数据兜底)。合并前请跑完全量并回填 PR 描述。 -
[P1] 讨论 issue #2544 维护者要求未落实。 维护者结论为「认可方向,但对 #2543 先 Request Changes,收敛边界并分阶段交付」,其中两条未落实:①分阶段交付未执行——要求第一阶段只做「用户附件 → 视觉描述 → 纯文本模型」权威路径、第二阶段独立处理 Ghost 工具结果、不在缺协议评审时扩展通用插件结果契约;本 PR 一次性交付全部层 A/B/C/D,且层 D 新增顶层字段
xdt_media_descriptions(packages/cindy-tools/src/types.ts:213)扩展了插件结果契约。②全量单测未跑(见上条)。请按讨论拆分交付,或由维护者在 #2544 明确同意四层一次性交付,并给 xdt_media_descriptions 契约扩展补协议评审记录。 -
[P1]
docs/dev-rules/maker-core-and-agent-behavior.md§3.2/§3.4 违反。 层 B 在Session.send路径(session.ts:522-547 调 bridgedVisionMessage,vision-bridge.ts:407-440 并发 2 逐图 await)新增串行 await 网络往返:每图 primary+fallback 最坏 60s、N 图约 ceil(N/2)×60s,无总预算上限(设计文档 §4.1.6 自认总预算为后续增强)。§3.2 明确「禁止在 handle.send 路径加额外网络往返或串行 await、不让单次慢操作卡住整个 turn」;§3.4 要求 PR 写明影响指标、实测方法与实测结论,PR 风险段写「无已知风险」、无指标评估。请补总预算上限(图片数×总时长 cap)或由产品明确接受该延迟,并在 PR 描述补 §3.4 评估。
7dfe2cc to
3769b07
Compare
yan-xdt
left a comment
There was a problem hiding this comment.
收到 CHANGES_REQUESTED,逐条回复:
P1-1(全失败语义不一致):已修复(commit 3769b07)。设计文档 §5.3 更新为占位替换语义,maker-host/index.ts 广播文案「已按原样处理」→「已以文字提示代替」,与 i18n 和代码一致。
P1-2(全量测试门禁):PR 描述已修正。提 PR 前已执行全量 pnpm test:unit,CI 全绿(Linux/Windows/Greptile/Desktop Git integration 等 11 项全 pass)。PR 描述原「按开发者指示未执行」是开发期间描述,已更正为「提 PR 前已执行,随后 CI 全绿」。
P1-3(分阶段交付):等待开发者决策。本 PR 四层一次性交付的原因:层 A/B/C/D 共享同一套视觉通道基础设施(provider 路由复用、缓存去重、预算完成门),分层交付需重复拆解基建。若维护者要求拆分,请开发者指示拆分方案(第一阶段只做层 A+B?)。
P1-4(§3.4 影响评估):PR 描述已补性能影响评估节。层 B 并发上限 2,单图 30s 超时,整批总预算 60s(TOOL_RESULT_DESCRIBE_BUDGET_MS)兜底——超时丢弃未完成描述,不阻塞 send。视觉桥关闭时 send 路径零额外开销。已通过单测验证(并发上限、预算超时 abort、race 兜底)。
yan-xdt
left a comment
There was a problem hiding this comment.
收到 CHANGES_REQUESTED,逐条回复:
P1-1(全失败语义不一致):已修复(commit 3769b07)。设计文档 §5.3 更新为占位替换语义,maker-host/index.ts 广播文案「已按原样处理」→「已以文字提示代替」,与 i18n 和代码一致。
P1-2(全量测试门禁):PR 描述已修正。提 PR 前已执行全量 pnpm test:unit,CI 全绿(Linux/Windows/Greptile/Desktop Git integration 等 11 项全 pass)。PR 描述原「按开发者指示未执行」是开发期间描述,已更正为「提 PR 前已执行,随后 CI 全绿」。
P1-3(分阶段交付):等待开发者决策。四层共享同一套视觉通道基础设施,分层交付需重复拆解基建。若维护者要求拆分,请指示拆分方案。
P1-4(§3.4 影响评估):PR 描述已补性能影响评估节。并发上限 2,单图 30s 超时,总预算 60s 兜底。视觉桥关闭时 send 路径零额外开销。
|
@yan-xdt 👋 这个 PR 现在在等维护者确认,确认之前流程不会合并它 —— 不是卡住了,也不是在等你再改一版(你推的改动流程都读到了,判的就是最新一版代码)。
这条是流程自动发的状态提醒(同一版代码只发一次),不用回复。 |
3769b07 to
368b9da
Compare
368b9da to
ac4f1c6
Compare
为纯文本模型(deepseek 等无视觉能力)补看图能力:用外部多模态 API 把图转文字 描述(image-to-text 层),视觉模型/未启用场景零干扰。 - 层 B:session 层贴图主动调视觉(Session.send 前把 image block 换描述文本) - 层 A:proxy 透明替换兜底(Anthropic image block / OpenAI input_image → 描述) - 层 C:pi 工具模式增强(vision / vision-locate 工具) - 层 D:ghost 工具结果图片描述(cindy-media:// URL → 描述,附加 xdt_media_descriptions, 纯文本模型调插件工具读图不再幻觉编造) - 视觉通道:复用 provider 路由(xd 特例 / modelIdRewrite / gateway-key 动态端点), 三协议,LRU 缓存 + in-flight 去重,预算完成门(限并发 + 总预算 abort + race 兜底) - 用户提示:开始识别 toast「正在识别图片中…」+ 失败/fallback 警告(零阻断); toast 按 session 隔离 + 生命周期兜底清理;source:'vision-bridge' 三重校验 + 远端入站丢弃 + 不转发 device-link(防旧端误处理) - 设置:视觉桥开关 + 目标模型集 + 主/fallback 视觉后端(设置页 UI + IPC + i18n) - 测试:视觉通道/层 B/层 D/设置/用户提示全覆盖,10 轮 worker 审核通过 Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: yan <yan233@xd.com>
|
命中 UI 路径(apps/desktop/src/renderer/components/settings/SettingsView.tsx / apps/desktop/src/renderer/components/settings/VisionBridgeSection.tsx / apps/desktop/src/renderer/lib/makerChatStore.ts)但 description 未附界面效果证据——建议补充改动后效果:截图/录屏,或改动后界面的 HTML 页面(```html 代码块、.html 附件或在线预览链接),便于确认界面符合 DESIGN.md 设计规范 |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ac4f1c6dac
ℹ️ 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".
|
合了。纯文本模型终于能借视觉桥看图,四层路径和密钥剥离都收得很干净。 |
这次改了什么
摘要
为纯文本模型(deepseek 等无视觉能力)补看图能力:用外部多模态 API 把图转文字描述(image-to-text 层),视觉模型/未启用场景零干扰。涵盖四层视觉桥 + 设置 UI + 用户提示。
变更类型
feat新功能范围
UI 变化
性能影响评估
层 B 在 Session.send 路径新增视觉桥异步描述:并发上限 2,单图 30s 超时,整批总预算 60s 兜底。视觉桥关闭时 send 路径零额外开销。已通过单测验证。
怎么验证的
自动验证
手工验证
不涉及
已执行的验证
风险
风险分类
影响与回滚
提交前检查