Description
The "per-tool aggregate call stats" concept is modeled three separate times under different naming conventions, all carrying the same call-count/size/duration/error fields.
Suggested Changes
- Apply the same base-struct treatment as the MCP-server-stats consolidation (companion issue): introduce a shared base for call-count, size, duration and error fields.
- Do this together with the MCP-server-stats work since they share call sites in the audit report generators.
Files Affected
pkg/cli/audit_report.go:166 — ToolUsageInfo
pkg/cli/audit_report.go:184 — MCPToolSummary
pkg/cli/gateway_logs_types.go:97 — GatewayToolMetrics
Note: ToolUsageInfo may already be tracked for removal via #40803 in favor of workflow.ToolCallInfo — verify against that issue before duplicating scope, and prefer consolidating MCPToolSummary/GatewayToolMetrics around whichever canonical type wins.
Success Criteria
- Single canonical base/type for per-tool aggregate stats used across audit and gateway reports
- No behavior change in generated reports
- All existing tests pass
Source
Extracted from Typist: Go Type Consistency Analysis discussion #50544
Priority
Medium-High - companion to MCP-server-stats consolidation; estimated 2-3 hours
🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · auto · 44.7 AIC · ⌖ 3.06 AIC · ⊞ 10.3K · ◷
Description
The "per-tool aggregate call stats" concept is modeled three separate times under different naming conventions, all carrying the same call-count/size/duration/error fields.
Suggested Changes
Files Affected
pkg/cli/audit_report.go:166—ToolUsageInfopkg/cli/audit_report.go:184—MCPToolSummarypkg/cli/gateway_logs_types.go:97—GatewayToolMetricsNote:
ToolUsageInfomay already be tracked for removal via #40803 in favor ofworkflow.ToolCallInfo— verify against that issue before duplicating scope, and prefer consolidatingMCPToolSummary/GatewayToolMetricsaround whichever canonical type wins.Success Criteria
Source
Extracted from Typist: Go Type Consistency Analysis discussion #50544
Priority
Medium-High - companion to MCP-server-stats consolidation; estimated 2-3 hours