fix(opencode): ignore MCP resource file downloads#28466
Open
Arcadi4 wants to merge 1 commit into
Open
Conversation
10aa249 to
36c7904
Compare
Resolved the MCP resource @mention path so custom-scheme resources are still readable through resources/read, but their original URI is no longer forwarded to the model as a downloadable file attachment. That prevents the AI SDK from trying to fetch non-http schemes directly while preserving the resolved resource text in the prompt.
36c7904 to
6e2b571
Compare
1 task
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.
Issue for this PR
Closes #14753 #8920
Partial Fix #15535
Type of change
What does this PR do?
MCP resource @mentions are resolved through
resources/read, then stored as file parts with the original resource URI. For non-text/plainresources, model message conversion was forwarding that original custom URI to the AI SDK as a downloadable file, which caused schemes likestatus://orsimplifier://to fail URL validation.This keeps resolved MCP resource content in the prompt as text, but skips forwarding the original MCP resource file part to the model. The stored part remains available for history/UI, while the AI SDK no longer tries to download custom MCP schemes directly.
How did you verify your code works?
Ran the built artifact from the PR branch and verified that custom file URIs worked.
Screenshots / recordings
Checklist