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
- Remove the
workflowData parameter from IsMCPScriptsEnabled (or inline it as HasMCPScripts).
- 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
Estimated Effort: Small
Generated by Sergo - Serena Go Expert · ● 475.4K · ◷
Problem
IsMCPScriptsEnabledinpkg/workflow/mcp_scripts_parser.go:56carries a dead parameter:The function body ignores
workflowDataentirely and simply delegates toHasMCPScripts. There are 13 call sites across production files — all forced to pass the sameworkflowDatavalue 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.gocodex_engine.go,compiler_yaml_main_job.go(2×)engine_helpers.go,mcp_environment.go,mcp_detection.go,mcp_cli_mount.go,copilot_engine_tools.goBecause 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
workflowDataparameter fromIsMCPScriptsEnabled(or inline it asHasMCPScripts).Before:
After (option A — simplify signature):
After (option B — inline entirely):
Replace all call sites with
HasMCPScripts(workflowData.MCPScripts)and removeIsMCPScriptsEnabled.Impact
pkg/workflow/mcp_scripts_parser.go+ 13 call sites acrosspkg/workflow/workflowDatais used.Validation
go build ./pkg/workflow/...succeeds after all call sites updatedTestIsMCPScriptsEnabled*tests passgrep -r "IsMCPScriptsEnabled" pkg/shows no remaining two-argument callsEstimated Effort: Small