isGitHubCLIModeEnabled returns true when GitHub prompt/runtime mode is explicitly set to `tools.github.mode: gh-proxy`. If mode is explicitly set to `local` or `remote`, it takes precedence over the legacy features.cli-proxy flag (treated as MCP mode). When mode is not explicitly set, this returns t
(data *WorkflowData)
| 94 | // When mode is not explicitly set, this returns the legacy `features.cli-proxy` flag |
| 95 | // value for backward compatibility. |
| 96 | func isGitHubCLIModeEnabled(data *WorkflowData) bool { |
| 97 | if data == nil { |
| 98 | return false |
| 99 | } |
| 100 | githubTool, hasGitHub := data.Tools["github"] |
| 101 | if hasGitHub && githubTool == false { |
| 102 | return false |
| 103 | } |
| 104 | if hasGitHub { |
| 105 | if toolConfig, ok := githubTool.(map[string]any); ok { |
| 106 | if modeSetting, exists := toolConfig["mode"]; exists { |
| 107 | if stringValue, ok := modeSetting.(string); ok { |
| 108 | switch GitHubMCPMode(strings.ToLower(strings.TrimSpace(stringValue))) { |
| 109 | case GitHubMCPModeGHProxy, GitHubMCPModeCLI: |
| 110 | return true |
| 111 | case GitHubMCPModeLocal, GitHubMCPModeRemote: |
| 112 | return false |
| 113 | default: |
| 114 | githubConfigLog.Printf("Unrecognized tools.github.mode value: %s, falling back to legacy behavior", stringValue) |
| 115 | } |
| 116 | } |
| 117 | } |
| 118 | } |
| 119 | } |
| 120 | return isFeatureEnabled(constants.CliProxyFeatureFlag, data) |
| 121 | } |
| 122 | |
| 123 | // normalizeGitHubType normalizes and validates GitHub MCP transport values. |
| 124 | // Supported values are `local` and `remote`. |
no test coverage detected