Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

drop media content from MCP message attributes #17864

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
naaa760 wants to merge 11 commits into getsentry:develop
base: develop
Choose a base branch
Loading
from naaa760:msgs-drop-media

Conversation

Copy link

@naaa760 naaa760 commented Oct 5, 2025

PR Description

  • automatically filters out images, videos, audio, and other media content from MCP server message attributes to prevent large media from breaking instrumentation. Tracks dropped media via client reports.

fixes: #17810

Changes:

  • Added media detection logic for common file types (images, videos, audio, documents)
  • Filters media content from tool results and prompt results before attribute extraction
  • Integrates with existing client reports system to track dropped media
  • Preserves all text content while removing only media items

seer-by-sentry[bot] reacted with hooray emoji
@RulaKhaled RulaKhaled self-requested a review October 6, 2025 08:38
Copy link
Author

naaa760 commented Oct 7, 2025

@RulaKhaled
let me know, resolve it

const content = message.content;
if (typeof content.text === 'string') {
const attrName = messages.length === 1 ? `${prefix}.message_content` : `${prefix}.content`;
const attrName = filteredMessages.length === 1 ? `${prefix}.message_content` : `${prefix}.content`;
Copy link

@cursor cursor bot Oct 7, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Undefined Variable Causes Reference Error

A ReferenceError occurs because filteredMessages.length is referenced but filteredMessages is not defined in this scope. It looks like messages.length was the intended variable.

Fix in Cursor Fix in Web

Copy link
Author

naaa760 commented Oct 10, 2025

@RulaKhaled
have you reviwed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@cursor cursor[bot] cursor[bot] left review comments

@RulaKhaled RulaKhaled Awaiting requested review from RulaKhaled

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Drop Media from messages in SDKs and document behavior

1 participant

AltStyle によって変換されたページ (->オリジナル) /