Skip to content

[task] Refactor CopilotEngine to use unified MCPConfigRenderer #4020

@github-actions

Description

@github-actions

Objective

Update pkg/workflow/copilot_engine.go to use the unified MCPConfigRenderer instead of duplicated rendering functions.

Context

CopilotEngine currently has 4 duplicated MCP rendering functions with Copilot-specific fields (e.g., includeCopilotFields). These should be replaced with calls to the unified renderer. Related to #3942.

Approach

  1. Update copilot_engine.go to use NewMCPConfigRenderer() with Copilot-specific options
  2. Replace these functions with unified renderer calls:
    • renderGitHubCopilotMCPConfig() → Use renderer.RenderGitHubMCP()
    • renderPlaywrightCopilotMCPConfig() → Use renderer.RenderPlaywrightMCP()
    • renderSafeOutputsCopilotMCPConfig() → Use renderer.RenderSafeOutputsMCP()
    • renderAgenticWorkflowsCopilotMCPConfig() → Use renderer.RenderAgenticWorkflowsMCP()
  3. Configure renderer options with IncludeCopilotFields: true
  4. Update tests to verify Copilot-specific behavior is preserved

Files to Modify

  • pkg/workflow/copilot_engine.go - Update to use unified renderer
  • pkg/workflow/copilot_engine_test.go - Update tests if needed

Acceptance Criteria

  • All 4 Copilot MCP rendering functions replaced with unified renderer calls
  • CopilotEngine configured with IncludeCopilotFields: true option
  • All existing tests pass without modification to expected behavior
  • Code compiles without errors
  • No duplicate rendering logic remains in copilot_engine.go
  • Copilot-specific fields are correctly included in MCP configuration output
    Related to [refactor] 🔧 Semantic Function Clustering Analysis: Refactoring Opportunities #3942

AI generated by Plan Command for #3942

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions