fix(mcp): 优先读取本地高清图片,补齐远程补图与转发定位参数 - #157
Merged
2977094657 merged 1 commit intoSep 24, 2026
Merged
2977094657 merged 1 commit into
2977094657 merged 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
解决的问题
通过 Codex 等 MCP 客户端读取历史图片时,
wechat.media.get_chat_image_url没有透传后端已支持的fetch_remote参数,工具的参数声明也为空。即使客户端明确要求加载大图,生成的链接仍无法触发该次远程补图;默认请求也没有启用按实际像素尺寸比较本地候选图片的逻辑。修改后的行为
prefer_live=true,复用后端已有逻辑比较本地候选图,优先较高清版本;调用方仍可显式设为false。fetch_remote,并在 MCP schema 和描述中公开用法。显式请求大图时,后端优先使用本地大图,缺失时可尝试 CDN 下载。没有默认打开远程补图,下载仍受现有服务额度和可用性约束。src_create_time、file_size、record_index、record_index_path、record_attach的传递,保留历史图片和合并转发图片的定位信息;兼容msg_svr_id别名。验证
基于上游最新 main 执行以下回归:65 passed,145 subtests passed(另有 2 条现有 LangGraph 实验性接口警告)。
限制
真实测试中,一张本地仅有 210×118 图片的旧消息已触发 CDN 请求,但最终返回 404,未恢复原图。本 PR 修复取图接口能力,不保证已丢失或远端不可用的原图能够恢复;模拟下载成功不能等同于所有真实图片均可补回。内置 AI 的 1600 像素预处理逻辑未改动。
完整 dev 验证记录见
docs/image-mcp-dev-verification-2026-09-24.md。