-
Notifications
You must be signed in to change notification settings - Fork 46
Replace awmg with gh-aw-mcpg as MCP gateway #9171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -225,13 +225,23 @@ func (e *CopilotEngine) GetExecutionSteps(workflowData *WorkflowData, logFile st | |
| // Check if safe-inputs is enabled to include host.docker.internal in allowed domains | ||
| hasSafeInputs := IsSafeInputsEnabled(workflowData.SafeInputs, workflowData) | ||
|
|
||
| // Check if MCP gateway is enabled | ||
| hasMCPGateway := IsMCPGatewayEnabled(workflowData) | ||
|
|
||
| // Get allowed domains (copilot defaults + network permissions + host.docker.internal if safe-inputs enabled) | ||
| allowedDomains := GetCopilotAllowedDomainsWithSafeInputs(workflowData.NetworkPermissions, hasSafeInputs) | ||
|
|
||
| // Build AWF arguments: mount points + standard flags + custom args from config | ||
| var awfArgs []string | ||
| awfArgs = append(awfArgs, "--env-all") | ||
|
|
||
| // Add --enable-host-access when MCP gateway is enabled | ||
| // This allows AWF containers to reach gh-aw-mcpg running on the host | ||
| if hasMCPGateway { | ||
| awfArgs = append(awfArgs, "--enable-host-access") | ||
| copilotExecLog.Print("Added --enable-host-access for MCP gateway access") | ||
| } | ||
|
Comment on lines
225
to
+243
|
||
|
|
||
| // Set container working directory to match GITHUB_WORKSPACE | ||
| // This ensures pwd inside the container matches what the prompt tells the AI | ||
| awfArgs = append(awfArgs, "--container-workdir", "\"${GITHUB_WORKSPACE}\"") | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The grep command on line 52 has a potential issue: it will match any container whose name contains "gh-aw-mcpg" anywhere in the output, not just the container name field. For example, it could match a container with an image name or other field containing that string.
Consider using docker ps with --filter "name=gh-aw-mcpg" directly in the condition instead of piping to grep, which would be more precise and avoid potential false positives. For example:
This ensures an exact match on the container name.