Skip to content

Activity Log: Show MCP agent metadata#22706

Merged
jkmassel merged 3 commits intotrunkfrom
jkmassel/activity-log-mcp-agent-metadata
Mar 19, 2026
Merged

Activity Log: Show MCP agent metadata#22706
jkmassel merged 3 commits intotrunkfrom
jkmassel/activity-log-mcp-agent-metadata

Conversation

@jkmassel
Copy link
Contributor

@jkmassel jkmassel commented Mar 18, 2026

Description

Adds support for displaying MCP (Model Context Protocol) agent metadata in the Activity Log, matching the iOS implementation (WordPress-iOS #25397).

When an activity was performed by an MCP agent, a "via {client}" label (e.g., "via Claude") is now shown in both the list view and the detail view.

Changes across the full data pipeline:

  • API parsing: Added is_mcp_agent and mcp_client fields to the REST client actor response model
  • Data model: Added isMCPAgent and mcpClient to ActivityLogModel.ActivityActor
  • Database: Added MCP_AGENT and MCP_CLIENT columns to the ActivityLog table with migration (v211→212)
  • List view: Shows "· via {client}" next to the summary text using a dot separator
  • Detail view: Shows "via {client}" below the actor role

Ref: AIINT-290

Screenshots

activity_log_current activity_log_detail3

Testing instructions

Verify MCP metadata in Activity Log list:

  1. Log in to a site that has activity log entries from MCP agents
  2. Navigate to Activity Log from the menu
  • Verify entries from MCP agents show "· via {client}" next to the summary (e.g., "Post modified · via Anthropic/ClaudeAI")
  • Verify entries without MCP metadata do NOT show the dot separator or metadata text

Verify MCP metadata in Activity Log detail:

  1. Tap on an activity log entry that was made by an MCP agent
  • Verify the detail view shows the actor name, role, and "via {client}" below the role
  • Verify the layout does not clip or overlap with the date/time on the right

Verify non-MCP entries are unaffected:

  1. Tap on a regular (non-MCP) activity log entry
  • Verify the detail view shows actor name and role as before, with no extra metadata line

🤖 Generated with Claude Code

Display "via {client}" label (e.g. "via Claude") in the Activity Log
when an entry was performed by an MCP agent. Adds isMCPAgent and
mcpClient fields through the full data pipeline: API response parsing,
database persistence with migration, and UI rendering in both the
list and detail views.

Ref: AIINT-290

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@dangermattic
Copy link
Collaborator

dangermattic commented Mar 18, 2026

1 Warning
⚠️ This PR is assigned to the milestone 26.8. The due date for this milestone has already passed.
Please assign it to a milestone with a later deadline or check whether the release for this milestone has already been finished.

Generated by 🚫 Danger

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 18, 2026

App Icon📲 You can test the changes from this Pull Request in WordPress Android by scanning the QR code below to install the corresponding build.

App NameWordPress Android
Build TypeDebug
Versionpr22706-d6bb765
Build Number1487
Application IDorg.wordpress.android.prealpha
Commitd6bb765
Installation URL2b4ksv3qq4p8g
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@wpmobilebot
Copy link
Contributor

wpmobilebot commented Mar 18, 2026

App Icon📲 You can test the changes from this Pull Request in Jetpack Android by scanning the QR code below to install the corresponding build.

App NameJetpack Android
Build TypeDebug
Versionpr22706-d6bb765
Build Number1487
Application IDcom.jetpack.android.prealpha
Commitd6bb765
Installation URL1ufpucdtgder0
Automatticians: You can use our internal self-serve MC tool to give yourself access to those builds if needed.

@jkmassel jkmassel requested a review from adalpari March 18, 2026 20:58
@jkmassel jkmassel self-assigned this Mar 18, 2026
@jkmassel jkmassel added this to the 26.8 milestone Mar 18, 2026
Suppress LongParameterList for Actor class and extract hardcoded
dot separator to a string resource.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@codecov
Copy link

codecov bot commented Mar 18, 2026

Codecov Report

❌ Patch coverage is 70.21277% with 14 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.50%. Comparing base (cc26b8d) to head (d6bb765).
⚠️ Report is 4 commits behind head on trunk.

Files with missing lines Patch % Lines
...s/android/fluxc/persistence/ActivityLogSqlUtils.kt 0.00% 9 Missing ⚠️
...rdpress/android/fluxc/persistence/WellSqlConfig.kt 33.33% 2 Missing ⚠️
...d/viewmodel/activitylog/ActivityActorExtensions.kt 80.00% 0 Missing and 1 partial ⚠️
...twork/rest/wpcom/activity/ActivityLogRestClient.kt 85.71% 0 Missing and 1 partial ⚠️
...xc/network/rest/wpcom/dashboard/CardsRestClient.kt 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##            trunk   #22706   +/-   ##
=======================================
  Coverage   37.49%   37.50%           
=======================================
  Files        2286     2287    +1     
  Lines      120484   120513   +29     
  Branches    16501    16510    +9     
=======================================
+ Hits        45173    45195   +22     
- Misses      71637    71645    +8     
+ Partials     3674     3673    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jkmassel jkmassel marked this pull request as ready for review March 19, 2026 01:13
- Extract duplicated MCP formatting into ActivityActorExtensions
- Remove unnecessary intermediate variable in detail ViewModel
- Pass uiHelpers to EventItemViewHolder for consistent visibility handling
- Add unit tests for MCP metadata in both list and detail ViewModels

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@sonarqubecloud
Copy link

Copy link
Contributor

@adalpari adalpari left a comment

Choose a reason for hiding this comment

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

LGTM and works as expected!

Image

@jkmassel jkmassel merged commit f354840 into trunk Mar 19, 2026
28 of 29 checks passed
@jkmassel jkmassel deleted the jkmassel/activity-log-mcp-agent-metadata branch March 19, 2026 16:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants