Skip to content

[Code Quality] Embed AggregatedSummaryBase in MCPFailureSummary (logs_models.go) #46002

Description

@github-actions

Description

MCPFailureSummary in pkg/cli/logs_models.go (line 173) re-declares 4 fields — Count, Workflows, WorkflowsDisplay, and RunIDs — that are already defined in AggregatedSummaryBase (line 157). The sibling types MissingToolSummary and MissingDataSummary already correctly embed AggregatedSummaryBase, but MCPFailureSummary does not, creating copy-paste drift. The base type's doc comment even flags that sibling types should embed it.

Suggested Changes

  • Replace the four duplicate field declarations in MCPFailureSummary with AggregatedSummaryBase embedding
  • Align with the existing pattern used by MissingToolSummary and MissingDataSummary
// Before:
type MCPFailureSummary struct {
    Count            int      `json:"count"`
    Workflows        []string `json:"workflows"`
    WorkflowsDisplay string   `json:"workflows_display"`
    RunIDs           []string `json:"run_ids"`
    // ... MCPFailureSummary-specific fields
}

// After:
type MCPFailureSummary struct {
    AggregatedSummaryBase
    // ... MCPFailureSummary-specific fields
}

Files Affected

  • pkg/cli/logs_models.go (lines 157-200, update MCPFailureSummary struct)

Success Criteria

  • MCPFailureSummary embeds AggregatedSummaryBase instead of redeclaring its fields
  • All references to MCPFailureSummary.Count, .Workflows, etc. still work (embedding is transparent)
  • make fmt && make golint-custom && go test ./pkg/cli/... passes
  • JSON serialization output is unchanged

Effort

~30 min · XS

Source

Extracted from Typist — Go Type Consistency Analysis discussion #45983

Priority

Medium — kills copy-paste drift and matches the established embedding pattern

🔍 Task mining by Discussion Task Miner - Code Quality Improvement Agent · 156.6 AIC · ⌖ 7.84 AIC · ⊞ 7K ·

  • expires on Jul 17, 2026, 5:23 AM UTC-08:00

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions