Repository navigation
fix(agent-core-v2): reuse uploaded MCP tool images - #4767
Merged
7Sageer merged 1 commit intoNov 9, 2026
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
🦋 Changeset detectedLatest commit: d908a7e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
7Sageer
approved these changes
Nov 9, 2026
This was referenced Nov 10, 2026
Closed
Closed
Merged
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.
Requirement or Bug
在会话中多次调用返回图片的 MCP 工具,例如截图工具。只要旧截图还在上下文里,后续模型请求就会重复发送它的全部数据,导致请求体变大,在慢速网络上可能超时。
Bug Reproduction Steps
Root Cause
MCP 转换层会保存原始附件,但输出给模型的图片字段仍然是内联数据。Core 只会对会话附件引用执行已有的图片上传和缓存逻辑。
Code Changes
转换只在新 MCP 结果生成时执行。无法使用上传引用时,支持内联图片的协议会回退到内联发送。
Behavior Changes and Affected Users
回归使用 MCP 的 PNG 图片格式走实际请求构建,模拟 HTTP 服务记录到一次文件上传,随后两次模型请求都使用同一个文件引用。还验证了原图复用和压缩图可读。没有在 Windows 上运行真实截图工具。
测试详情
git diff --check通过。src/human/agent/origin.ts。Checklist
/approve).gen-changesetsskill, or this PR needs no changeset.gen-docsskill, or this PR needs no doc update.