Repository navigation
fix(mcp): preserve original attachments omitted from model output - #3688
Conversation
🦋 Changeset detectedLatest commit: d9e84f7 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 |
Codex Review SummaryThis 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. |
commit: |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c4d331dcce
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: a624c1e33d
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 375df0c429
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: da85429da1
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: f8f96e1264
ℹ️ About Codex in GitHub
Your team has set up Codex to 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 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
🛡️ Codex Security Review · Automatically triggeredSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
Brings the fork's Rust engine up to the behaviors ported from upstream since 0.42.0, and moves the version to 2.0.0 to follow upstream (never bumped independently). Ports landed here, each recorded in packages/kimi-agent/ROADMAP.md §6.2 and scripts/upstream-v2-delta-allowlist.json with its own evidence: - MoonshotAI#3688 MCP media originals are preserved instead of flattened to a text preview: src/mcp/output.rs adds the content-block conversion and the result-to-delivery path, FileStore gains content-addressed writing, and the attachment reference is resolvable by Read/ReadMediaFile. - MoonshotAI#3734 streamed attempt state is invalidated when the LLM requester retries: a turn-scoped tool-call id ledger, streamed tool-call deltas from all three wire protocols, and an attempt guard that rolls back on every failure exit. - MoonshotAI#3697 steer interrupts a background-task wait — plus the blocking wait it needed. The engine's WaitFor had been routed through a synchronous local store, so a 5s wait returned in 6ms reporting a timeout; the toolset now waits on its own task runner, and a steer signal ends that wait early without cancelling the turn or its tasks. WaitFor gains the wait-any form. - MoonshotAI#3846 an MCP tool call returning 401 flips the server to needs-auth. - MCP servers connect once per process, starting at startup. - AI session titles are generated through the managed chat_title tool. - The abort fix in the preceding commit. Also refreshes the ROADMAP evidence blocks, the upstream delta allowlist, the bilingual docs those behaviors surface in, and the TUI rendering for the new wait status.
Related Issue
No linked issue. This fixes received MCP attachments being omitted without a usable original-file reference.
Problem
Unsupported embedded blobs and image formats, oversized binary parts, and audio/video omitted during provider conversion can disappear from the model-visible result. Saving only processed text cannot recover their original bytes. References must also remain usable after a session fork, and large attachment lists must not bypass the tool-output budget.
What changed
kimi-file://references alongside local paths. Read and ReadMediaFile read these references directly from session storage, independently of the active runtime filesystem. Pagination preserves the reference, so a fork can continue reading its own copy after the source file is removed. Binary Read errors expose the resolved local path for a converter.Session attachment readers remain registered without workspace FS access when the model supports the content, and returned media tags retain stable references for follow-up crops. Backing stores without local paths can still return usable attachment references.
Resource links are not downloaded. This adds neither format readers/converters nor an aggregate storage quota. Historical absolute paths are not rewritten; stable references resolve against the current session.
Validation
Client provider-matrix validation: all 21 end-to-end tests pass. The image-reference regression checks that the actual uploaded file reference is resolved and that the provider receives a data URL; documenting the generic
kimi-file://scheme in tool descriptions is allowed.Checklist
gen-changesetsskill.gen-docsskill.