fix(v10/core): resolve MCP capture policy per operation - #23796
Open
JPeer264 wants to merge 1 commit into
Open
Conversation
JPeer264
marked this pull request as ready for review
September 1, 2026 07:16
msonnb
approved these changes
Sep 1, 2026
Contributor
size-limit report 📦
|
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.
Backport of: #23437
Differences to the original PR
packages/core/src/integrations/mcp-server/transport.ts: the no-client fallback inresolveMcpOptionsisfalseforrecordInputs/recordOutputs, nottrue. On v10resolveDataCollectionOptionsstill routes through thesendDefaultPiibridge whendataCollectionis absent, so the oldwrapMcpServerWithSentrycode fell back tofalsewhen no client existed. Keepingtruehere would start capturing MCP inputs and outputs on a maintenance branch.packages/core/src/integrations/mcp-server/transport.ts:startInactiveSpanis imported from../../tracingtogether withwithActiveSpan; v10 has no separate../../tracing/traceimport in this file.packages/core/test/lib/integrations/mcp-server/capturePolicy.test.ts: the span-config helpers usesentry.sourceinstead ofsentry.segment.name.source, and the tool config carries a top-levelop: 'mcp.server', matching v10'sbuildMcpServerSpanConfig. The no-client case asserts that inputs and outputs are omitted, following the fallback above.dev-packages/e2e-tests/test-applications/node-express/src/app.ts: thedataCollection.genAIblock is not added. On v10 the presence of anydataCollectionkey switches the resolution base from thesendDefaultPiibridge to the permissive spec defaults, which would have flippeduserInfo,cookies,httpHeaders,httpBodiesanddatabaseQueryDataon for every other test in this app. Without the block,genAIalready resolves to{ inputs: false, outputs: false }, so the new MCP e2e assertions hold unchanged.dev-packages/e2e-tests/test-applications/cloudflare-mcp-agent/src/index.ts: thegenAIsettings are merged into the existingdataCollection: { userInfo: true }object. v10 already setsdataCollectionin bothSentry.initcalls, so the original patch would have produced a duplicate key and silently droppeduserInfo: true.