improvement(stats): should track mcp and a2a executions like other trigger types#2895
Merged
icecrasher321 merged 2 commits intostagingfrom Jan 20, 2026
Merged
improvement(stats): should track mcp and a2a executions like other trigger types#2895icecrasher321 merged 2 commits intostagingfrom
icecrasher321 merged 2 commits intostagingfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
Greptile SummaryThis PR extends the execution tracking system to include MCP (Model Context Protocol) and A2A (Agent-to-Agent) trigger types, bringing them to parity with existing trigger types like manual, API, webhook, schedule, and chat. Key Changes:
Implementation Quality:
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Workflow
participant ExecutionLogger
participant Database
participant AdminAPI
Note over Workflow,Database: MCP/A2A Execution Flow
Workflow->>ExecutionLogger: finalize(costSummary, trigger='mcp'|'a2a')
ExecutionLogger->>ExecutionLogger: Check trigger type in switch
alt trigger is 'mcp'
ExecutionLogger->>Database: UPDATE user_stats SET total_mcp_executions = total_mcp_executions + 1
else trigger is 'a2a'
ExecutionLogger->>Database: UPDATE user_stats SET total_a2a_executions = total_a2a_executions + 1
end
ExecutionLogger->>Database: Update totalCost, totalTokensUsed, currentPeriodCost
Database-->>ExecutionLogger: Stats updated
Note over AdminAPI,Database: Admin Billing Query
AdminAPI->>Database: SELECT * FROM user_stats WHERE userId = ?
Database-->>AdminAPI: Return stats including totalMcpExecutions, totalA2aExecutions
AdminAPI->>AdminAPI: Map to AdminUserBilling response
AdminAPI-->>AdminAPI: Return billing data with MCP/A2A counts
|
Contributor
There was a problem hiding this comment.
Additional Comments (2)
-
apps/sim/app/api/v1/admin/types.ts, line 548-552 (link)logic: Missing
totalMcpExecutionsandtotalA2aExecutionsfields that were added to theuser_statstable -
apps/sim/app/api/v1/admin/users/[id]/billing/route.ts, line 95-99 (link)logic: Missing mappings for
totalMcpExecutionsandtotalA2aExecutionsfields
4 files reviewed, 2 comments
Collaborator
Author
|
@greptile |
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.
Summary
Track MCP and A2A trigger executions like the others.
Type of Change
Testing
Tested manually
Checklist