Uh oh!
There was an error while loading. Please reload this page.
feat(mcp): forward plugin request metadata - #38579
Open
dialupdisaster wants to merge 1 commit into
Open
Conversation
Contributor
The following comment was made by an LLM, it may be inaccurate: Based on my search, I found related PRs that should be reviewed for context: Potentially Related PRs:
These are not duplicates but rather related/predecessor work. The current PR (#38579) is an updated implementation of the approach outlined in #21624 adapted for current MCP tool paths. |
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 freeto 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#17084
Updates the implementation proposed in #21539 and #21624 for the current MCP tool paths.
Type of change
What does this PR do?
Plugins can now set optional
_metafields intool.execute.before. OpenCode forwards them to downstream MCPtools/callrequests without exposing them as tool arguments.The forwarding covers both normal MCP tools and code-mode child calls. A shared call path preserves MCP SDK 1.29's own metadata, including progress tokens, and supports SEP-414 trace context without adding metadata by default.
How did you verify your code works?
bun typecheckinpackages/opencodeandpackages/pluginbun typecheck(30 packages)env -u OPENCODE_DISABLE_CLAUDE_CODE bun testinpackages/opencode(3,199 pass, 0 fail)bun run test:httpapiinpackages/opencode(208/208 in coverage, auth, and effect modes)bun lintstill reports the existing octal-escape error inpackages/session-ui/src/v2/components/prompt-input/index.tsx; changed files have no lint errors.Screenshots / recordings
Not applicable; no UI changes.
Checklist