Repository navigation
fix(issues): Rename claude-desktop MCP client family to claude - #127717
Draft
sentry-junior[bot] wants to merge 1 commit into
Draft
sentry-junior[bot] wants to merge 1 commit into
sentry-junior[bot] wants to merge 1 commit into
Conversation
The MCP labels every Claude-User request as claude-desktop, but that user agent covers all of Claude's hosted apps (claude.ai, Desktop, routines), so activity from e.g. Claude routines was attributed to Claude Desktop. Accept the new claude family, map legacy claude-desktop headers to it at write time, and rename mcp:claude-desktop on read so existing action log rows (which are never migrated) serialize as mcp:claude. Co-Authored-By: Matt Duncan <matt.duncan@sentry.io>
This branch has not been deployed
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.
The MCP server labels every request with a
Claude-Useruser agent asclaude-desktop. That user agent is Anthropic's generic one for user-directed requests from Claude's hosted apps, so it can't tell Desktop apart from claude.ai or Claude routines. As a result, issue activity from Claude routines showed up as "Claude Desktop".This PR replaces
claude-desktopwith a singleclaudefamily.claude-codestays separate because it has its ownclaude-code/x.yuser agent.KNOWN_MCP_CLIENT_FAMILIESnow acceptsclaude.get_mcp_client_familymaps a legacyclaude-desktopheader toclaude. New action log rows are written asmcp:claudeeven before the MCP change deploys, so the deploy order doesn't matter.client_hostattribution gets the same mapping.GroupActionLogEntryserializer renames existingmcp:claude-desktoprows tomcp:claudewhen it reads them. Action log rows are append-only and never migrated (seeissues/action_log/AGENTS.md), so they are renamed on read and not backfilled.The matching MCP-side change is in getsentry/toolkit (
client-family.ts).Tests
tests/sentry/issues/test_action_log.py: a legacyclaude-desktopheader resolves tomcp:claude.tests/sentry/api/serializers/test_groupactionlogentry.py: a storedmcp:claude-desktoprow serializes asmcp:claude, andmcp:claude-codeis unchanged.I ran
ruff checkandruff format --checkon the changed files locally. I couldn't run pytest in the sandbox because it has no database, so CI will be the first real run.via matt.duncan.
--
View Junior Session [Sentry]