Skip to content

cleanup: remove unused workflowData parameter from IsMCPScriptsEnabled #28798

@github-actions

Description

@github-actions

Problem

IsMCPScriptsEnabled in pkg/workflow/mcp_scripts_parser.go:56 carries a dead parameter:

// The workflowData parameter is kept for backward compatibility but is not used.
func IsMCPScriptsEnabled(mcpScripts *MCPScriptsConfig, workflowData *WorkflowData) bool {
    return HasMCPScripts(mcpScripts)
}

The function body ignores workflowData entirely and simply delegates to HasMCPScripts. There are 13 call sites across production files — all forced to pass the same workflowData value they already have on hand for no purpose:

  • mcp_setup_generator.go (3×)
  • claude_engine.go, codex_mcp.go, copilot_engine_execution.go, copilot_engine.go
  • codex_engine.go, compiler_yaml_main_job.go (2×)
  • engine_helpers.go, mcp_environment.go, mcp_detection.go, mcp_cli_mount.go, copilot_engine_tools.go

Because this is entirely internal code (all callers are within pkg/workflow), the "backward compatibility" rationale does not apply — there is no external API contract to honour.

Recommendation

  1. Remove the workflowData parameter from IsMCPScriptsEnabled (or inline it as HasMCPScripts).
  2. Update all 13 call sites to remove the second argument.

Before:

func IsMCPScriptsEnabled(mcpScripts *MCPScriptsConfig, workflowData *WorkflowData) bool {
    return HasMCPScripts(mcpScripts)
}
// call site:
if IsMCPScriptsEnabled(workflowData.MCPScripts, workflowData) {

After (option A — simplify signature):

func IsMCPScriptsEnabled(mcpScripts *MCPScriptsConfig) bool {
    return HasMCPScripts(mcpScripts)
}
// call site:
if IsMCPScriptsEnabled(workflowData.MCPScripts) {

After (option B — inline entirely):
Replace all call sites with HasMCPScripts(workflowData.MCPScripts) and remove IsMCPScriptsEnabled.

Impact

  • Severity: Low (API hygiene, not a bug)
  • Affected file: pkg/workflow/mcp_scripts_parser.go + 13 call sites across pkg/workflow/
  • Risk: Zero functional risk; purely a cleanup. Reduces cognitive overhead and avoids misleading future readers who may assume workflowData is used.

Validation

  • go build ./pkg/workflow/... succeeds after all call sites updated
  • All existing TestIsMCPScriptsEnabled* tests pass
  • grep -r "IsMCPScriptsEnabled" pkg/ shows no remaining two-argument calls

Estimated Effort: Small

Generated by Sergo - Serena Go Expert · ● 475.4K ·

  • expires on May 4, 2026, 8:44 PM UTC

Metadata

Metadata

Labels

cookieIssue Monster Loves Cookies!sergo

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions