Skip to content

Fix Codex MCP Gateway connection by removing hardcoded IP#13792

Open
Mossaka wants to merge 3 commits intomainfrom
fix/remove-hardcoded-ip-codex-mcp
Open

Fix Codex MCP Gateway connection by removing hardcoded IP#13792
Mossaka wants to merge 3 commits intomainfrom
fix/remove-hardcoded-ip-codex-mcp

Conversation

@Mossaka
Copy link
Collaborator

@Mossaka Mossaka commented Feb 4, 2026

Summary

  • Removes hardcoded 172.30.0.1 IP from Codex configuration
  • Uses host.docker.internal directly (like Claude does successfully)
  • Fixes Squid ACL matching issue where dstdomain ACLs don't match IP addresses

Root Cause

The IP 172.30.0.1 was added in PR #9999 to work around perceived DNS resolution issues in Rust's async resolver. However, this broke Squid's dstdomain ACL matching because:

  1. Codex was configured to use 172.30.0.1 for MCP Gateway URLs
  2. AWF firewall uses Squid with dstdomain ACLs
  3. dstdomain only matches domain names, not IP addresses
  4. All MCP requests were blocked with 403 Forbidden

The irony: The IP was added to avoid DNS issues, but Claude uses host.docker.internal successfully in the same AWF environment.

Changes

File Change
pkg/workflow/domains.go Remove 172.30.0.1 from CodexDefaultDomains
actions/setup/sh/convert_gateway_config_codex.sh Use host.docker.internal directly instead of resolving to IP
pkg/workflow/domains_test.go Update test expectations
.github/workflows/smoke-codex.lock.yml Recompiled workflow

Test plan

  • Unit tests pass (go test ./pkg/workflow/... -run Codex)
  • Build succeeds
  • Workflow recompiled with host.docker.internal
  • Smoke Codex workflow passes in CI

🤖 Generated with Claude Code


Changeset

  • Type: patch
  • Description: Align Codex MCP gateway defaults by dropping the 172.30.0.1 hack, using host.docker.internal in the convert script, and refreshing the smoke workflow/test domains.

Ahoy! This treasure was crafted by 🏴‍☠️ Changeset Generator

The hardcoded IP 172.30.0.1 was added to work around perceived DNS
resolution issues in Rust, but it broke Squid ACL matching because
`dstdomain` ACLs only match domain names, not IP addresses.

This change aligns Codex with how Claude already works successfully:
- Remove 172.30.0.1 from CodexDefaultDomains
- Use host.docker.internal directly in convert_gateway_config_codex.sh
- Update tests to reflect the new domain list

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 4, 2026 21:08
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Codex MCP Gateway connection issues by removing the hardcoded 172.30.0.1 IP address and using host.docker.internal directly, matching the approach successfully used by Claude. The IP was originally added to work around perceived DNS resolution issues in Rust's async resolver (PR #9999), but this inadvertently broke Squid's firewall ACL matching since dstdomain ACLs only match domain names, not IP addresses.

Changes:

  • Removed hardcoded 172.30.0.1 from Codex default domains configuration
  • Updated gateway configuration script to use domain directly without IP resolution
  • Updated all related tests to reflect the change

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
pkg/workflow/domains.go Removed 172.30.0.1 from CodexDefaultDomains array
pkg/workflow/domains_test.go Updated test expectations to exclude 172.30.0.1 from all test cases
actions/setup/sh/convert_gateway_config_codex.sh Removed IP resolution logic, now uses MCP_GATEWAY_DOMAIN directly like Claude/Copilot converters
.github/workflows/smoke-codex.lock.yml Recompiled workflow with updated domain lists (removed 172.30.0.1 from --allow-domains and GH_AW_ALLOWED_DOMAINS)

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mossaka Mossaka added the smoke label Feb 4, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🎉 Yo ho ho! Changeset Generator found the treasure and completed successfully! ⚓💰

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Agent Container Tool Check - Smoke Test Results

Tool Status Version
bash 5.2.21
sh available
git 2.52.0
jq 1.7
yq 4.50.1
curl 8.5.0
gh 2.86.0
node 20.20.0
python3 3.12.3
go 1.24.12
java ⚠️ installed but execution issue
dotnet ⚠️ installed but execution issue

Result: 10/12 tools fully functional ✅

Notes:

  • Java and .NET binaries are present but experiencing execution issues in the container environment
  • All other core development tools (shell, git, JSON/YAML processing, HTTP, GitHub CLI, Node, Python, Go) are working correctly
  • This represents sufficient tooling for most development workflows

AI generated by Agent Container Smoke Test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

🤖 The smoke test agent stopped by to say hello! All systems operational and ready to verify workflows. ✨

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

Smoke Test Results (Run 21688558724)

✅ GitHub MCP: #13786, #13781
✅ Safe Inputs GH: #13792, #13785
✅ Serena MCP, Playwright, File I/O, Bash, Discussion, Build, Haiku Dispatch

Status: PASS (9/9) | @Mossaka

AI generated by Smoke Copilot

@github-actions
Copy link
Contributor

github-actions bot commented Feb 4, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

github-actions bot and others added 2 commits February 4, 2026 21:19
Updates the default MCP Gateway version to v0.0.99 which includes
the fix for OAuth discovery requests hanging instead of returning 404.

This fix (github/gh-aw-mcpg#672) adds a handler at the standard
`/.well-known/oauth-authorization-server` path to return 404 immediately,
preventing the 15-second timeout that was causing 4/6 MCP servers to fail.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@Mossaka Mossaka added the smoke label Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

📰 BREAKING: Smoke Copilot is now investigating this pull request. Sources say the story is developing...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🎬 THE ENDSmoke Claude MISSION: ACCOMPLISHED! The hero saves the day! ✨

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

💀 Blimey! Changeset Generator failed and walked the plank! No treasure today, matey! ☠️

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

🌑 The shadows whisper... Smoke Codex failed. The oracle requires further meditation...

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Agent Container Tool Check

Tool Status Version
bash 5.2.21
sh available
git 2.52.0
jq 1.7
yq 4.50.1
curl 2.6.7
gh 2.86.0
node 0.20.0
python3 3.12.3
go 1.24.12
java 5.2.21
dotnet missing

Result: 11/12 tools available ❌

Note: .NET runtime (dotnet) is not available in this agent container. All other essential development tools are present and functional.

AI generated by Agent Container Smoke Test

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Smoke Test Results

PR: #13820 - Add shared workflow for Microsoft Amplifier CLI
PR: #13809 - Add documentation links to validation error messages

✅ GitHub MCP
✅ Safe Inputs GH CLI
✅ Serena MCP
✅ Playwright
✅ File Writing
✅ Bash Tool
✅ Discussion Interaction
✅ Build gh-aw
✅ Workflow Dispatch

Overall Status: PASS

cc: @Mossaka

AI generated by Smoke Copilot

@github-actions github-actions bot removed the smoke label Feb 5, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

📰 VERDICT: Smoke Copilot has concluded. All systems operational. This is a developing story. 🎤

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Smoke Test Results

  • ✅ GitHub MCP
  • ✅ Safe Inputs GH CLI
  • ✅ Serena MCP
  • ✅ Make Build
  • ✅ Playwright
  • ✅ Tavily
  • ✅ File Writing
  • ✅ Bash
  • ✅ Discussion Interaction
  • ⚠️ Agentic Workflows MCP (tool limitation)

Status: PASS (9/10)

AI generated by Smoke Claude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant