Skip to content

Commit f833ced

Browse files
refactor: apply early-continue pattern and fix step numbering in cli-proxy changes (#25037)
1 parent 00638e2 commit f833ced

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

pkg/workflow/mcp_setup_generator.go

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,14 @@ func (c *Compiler) generateMCPSetup(yaml *strings.Builder, tools map[string]any,
9191
if toolValue == false {
9292
continue
9393
}
94+
// When cli-proxy is enabled, agents use the pre-authenticated gh CLI for GitHub
95+
// reads instead of the GitHub MCP server. Skip so it is not configured with the gateway.
96+
if toolName == "github" && isFeatureEnabled(constants.CliProxyFeatureFlag, workflowData) {
97+
mcpSetupGeneratorLog.Print("Skipping GitHub MCP server registration: cli-proxy feature flag is enabled")
98+
continue
99+
}
94100
// Standard MCP tools
95101
if toolName == "github" || toolName == "playwright" || toolName == "cache-memory" || toolName == "agentic-workflows" {
96-
// When cli-proxy is enabled, agents use the pre-authenticated gh CLI for GitHub
97-
// reads instead of the GitHub MCP server. Skip registering the GitHub MCP server
98-
// so it is not configured with the gateway.
99-
if toolName == "github" && isFeatureEnabled(constants.CliProxyFeatureFlag, workflowData) {
100-
mcpSetupGeneratorLog.Print("Skipping GitHub MCP server registration: cli-proxy feature flag is enabled")
101-
continue
102-
}
103102
mcpTools = append(mcpTools, toolName)
104103
} else if mcpConfig, ok := toolValue.(map[string]any); ok {
105104
// Check if it's explicitly marked as MCP type in the new format

pkg/workflow/unified_prompt_step.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ func (c *Compiler) collectPromptSections(data *WorkflowData) []PromptSection {
224224
}
225225
}
226226

227-
// 9b. GitHub tool-use guidance: directs the model to the correct mechanism for
227+
// 10. GitHub tool-use guidance: directs the model to the correct mechanism for
228228
// GitHub reads (and writes when safe-outputs is also enabled).
229229
// When cli-proxy is enabled, the agent uses the pre-authenticated gh CLI for reads
230230
// instead of a GitHub MCP server (which is not registered). Otherwise, the GitHub
@@ -255,7 +255,7 @@ func (c *Compiler) collectPromptSections(data *WorkflowData) []PromptSection {
255255
})
256256
}
257257

258-
// 10. PR context (if comment-related triggers and checkout is needed)
258+
// 11. PR context (if comment-related triggers and checkout is needed)
259259
hasCommentTriggers := c.hasCommentRelatedTriggers(data)
260260
needsCheckout := c.shouldAddCheckoutStep(data)
261261
permParser := NewPermissionsParser(data.Permissions)

0 commit comments

Comments
 (0)