Skip to content

docs(cursor): 补充 Agent Local 图片附件排查与接入方式 - #3982

Merged
deepcoldy merged 1 commit into
deepcoldy:masterfrom
Han-wangyu:docs/cursor-agent-local-image-attachments
Nov 28, 2026
Merged

deepcoldy merged 1 commit into
deepcoldy:masterfrom
Han-wangyu:docs/cursor-agent-local-image-attachments

Conversation

@Han-wangyu

Copy link
Copy Markdown
Contributor

背景

#3926 增加了 Cursor Agent Local 自定义网关的启动器示例。用 2026.11.22-e9042b2 和合成 PNG 复现了一个附件问题。CLI 成功执行 Read 后,Chat Completions 请求只带 Read image file: <path>,网关收不到对应图片数据。通过文本和工具调用测试的网关也可能遇到这个问题。

改动

  • 在中英文适配器文档的 Agent Local 小节补充图片验证方法。用只出现在图片中的随机码检查模型结果,并检查 Read 后请求是否有对应图片。
  • 记录 tmux 中直接粘贴图片路径的用法,以及如何配置支持图片工具结果的 Anthropic Messages 网关。文档给出协议选择、端点和鉴权头。 Anthropic 图片工具结果格式
  • 改动限于两份适配器文档。

验证

使用真实 Agent Local 2026.11.22-e9042b2、合成 PNG 和本地流式模拟网关。观察范围为 CLI 到网关的请求。

路径 模拟网关收到的内容
Chat Completions,位置参数传入含 <image path="…"> 的首轮提示 初始请求无对应 image_url
Chat Completions,交互 PTY 中驱动 Read role: tool 回传路径文本,对应图片数据缺失
Chat Completions,已有 tmux 会话中输入问题并单独粘贴带引号的图片路径 后续用户消息带有原生 image_url
Anthropic Messages,交互 PTY 中驱动 Read tool_result.content 含 image,解码后与合成 PNG 字节一致。模型发现使用 Bearer,Messages 使用 x-api-key
  • 在 docs-site 下运行 BOTMUX_DOCS_BASE=/botmux/ BOTMUX_DOCS_ASSET_PREFIX=/botmux/ npm exec --yes [email protected] -- pnpm build,构建通过并核对了中英文生成页面。
  • git diff --check 通过。

@deepcoldy deepcoldy left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

复审结论:可合,零阻断、零非阻断发现

审查 head fac7ccfcef55ee8e9c7968af2ecf88232bbd8a61:仅 docs-site/docs/zh/adapters.md 与 docs-site/docs/en/adapters.md 各 +9/-1,未改源码或测试;基于 9508af5300a3542813f6bfb2c33d743af77e44cb,0 behind,GitHub 报告可合并、无内容冲突。

改动核验

  • docs-site/docs/zh/adapters.md:160、docs-site/docs/en/adapters.md:160:Chat Completions 端点改为 /v1/models、/v1/chat/completions,与同节启动脚本的 /v1 base URL 自洽;Anthropic Messages 的端点与鉴权要求在 :179 单独说明,两种协议没有混写。
  • docs-site/docs/zh/adapters.md:173-179、docs-site/docs/en/adapters.md:173-179:中英文四段逐段对应,随机码验证、tmux 原生 image_url 规避和 Messages 图片工具结果配置边界一致。Botmux 侧前提与 src/core/session-manager.ts:1041-1055 的共用实现一致:附件以本地路径注入;本 PR 不涉及其他 CLI、后端或会话类型的行为变化。
  • Agent Local 闭源二进制的实际请求形状以 PR 描述中的真实版本抓包结果为证据,本次未重复搭建该环境;未发现文档内部或与 Botmux 实现相矛盾之处。

本地验证

  • BOTMUX_DOCS_BASE=/botmux/ BOTMUX_DOCS_ASSET_PREFIX=/botmux/ npm exec --yes [email protected] -- pnpm --dir docs-site build:通过。
  • 生成后的中英文页面均包含新增段落,Read image file: <path> 正确转义;strict-env 链接分别解析到 /botmux/bots-json.html#strict-env 与 /botmux/en/bots-json.html#strict-env,目标页面的 id="strict-env" 均存在。
  • git diff --check 9508af5300a3542813f6bfb2c33d743af77e44cb...HEAD:通过;构建后工作树保持干净。

CI

当前 13 项检查通过,仅剩 bun-test (1/4) 的同 SHA 重跑处于 queued。首次失败的文件、用例、test:250 就绪等待及 15.2 秒超时形态均与开放中的 #3957 相同,失败点在首条测试消息发出之前,不在本 PR 改动面;其余检查无新增失败。

@deepcoldy
deepcoldy merged commit 1bc66a0 into deepcoldy:master Nov 28, 2026
27 of 29 checks passed
@deepcoldy

Copy link
Copy Markdown
Owner

感谢 @Han-wangyu 的贡献,已合并 🎉

这个 PR 修正了 Chat Completions 网关的端点路径(补回 /v1 前缀,与启动脚本的 base URL 自洽),并补充了 Agent Local 图片附件的排查方法、tmux 规避手段和 Anthropic Messages 接入方式,中英文内容对齐、文档站构建通过。本次评审无阻断、无待改项,也没有遗留 follow-up。欢迎继续贡献!

@github-actions

Copy link
Copy Markdown

@Han-wangyu @deepcoldy 合入 master 后的 Midscene E2E 失败:Feishu live Midscene 失败。

这次运行覆盖 b0300b5…cbeb67d12(4 个提交),同批合入的还有 #3978 #3977 #3981,失败不一定由本 PR 引起。

用例 跑道 状态 失败信息
Antigravity basic bot flow feishu-core-clis failed openThreadForMessage: couldn't find topic entry containing "e2e-antigravity-1795902111520" within 30000ms
Claude DM thread mode gives each message its own topic and session feishu-core-dm-modes-claude failed Node "feishu.runScenario" timed out after 1800000ms.
Codex DM chat mode replies inline and keeps one session feishu-core-dm-modes-codex failed Node "feishu.runScenario" timed out after 1800000ms.
Claude group reply mode new-topic starts a session per topic feishu-core-group-modes failed Node "feishu.runScenario" timed out after 1800000ms.
Claude group @ mode always ignores messages without an @ feishu-core-group-modes failed Reply "ACK-e2e-gm-always-claude-2-1795910134297 RECALL ACK-" appeared 0 time(s) within 240000ms, expected 1 (clicked 直接开启会话 0×; re-opened 1×; repo card buttons 0 visible / 0 total, anchor matches 3, …
Claude group @ mode never answers without an @ feishu-core-group-modes failed Reply "ACK-e2e-gm-never-claude-1-1795910977602 RECALL ACK-" appeared 0 time(s) within 240000ms, expected 1 (clicked 直接开启会话 0×; re-opened 1×; repo card buttons 0 visible / 0 total, anchor matches 3, n…
Claude group @ mode ambient answers without an @ but yields to others feishu-core-group-modes failed Reply "ACK-e2e-gm-ambient-claude-1-1795911803177 RECALL ACK-" appeared 0 time(s) within 240000ms, expected 1 (clicked 直接开启会话 0×; re-opened 1×; repo card buttons 0 visible / 0 total, anchor matches 3,…
Consecutive message queue feishu-core-queue failed Node "feishu.runScenario" timed out after 1800000ms.
Sandbox hides home and harness secrets feishu-core-sandbox failed openThreadForMessage: couldn't find topic entry containing "e2e-sbx-1795907974699" within 30000ms

@github-actions

Copy link
Copy Markdown

🚀 Released in v3.59.38

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants