Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/patch-remove-codex-hardcoded-ip.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 5 additions & 5 deletions .github/workflows/smoke-codex.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 2 additions & 9 deletions actions/setup/sh/convert_gateway_config_codex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,15 +61,8 @@ echo "Target domain: $MCP_GATEWAY_DOMAIN:$MCP_GATEWAY_PORT"
# Note: URLs must use the correct domain (host.docker.internal) for container access

# Build the correct URL prefix using the configured domain and port
# For host.docker.internal, resolve to the gateway IP to avoid DNS resolution issues in Rust
if [ "$MCP_GATEWAY_DOMAIN" = "host.docker.internal" ]; then
# AWF network gateway IP is always 172.30.0.1
RESOLVED_DOMAIN="172.30.0.1"
echo "Resolving host.docker.internal to gateway IP: $RESOLVED_DOMAIN"
else
RESOLVED_DOMAIN="$MCP_GATEWAY_DOMAIN"
fi
URL_PREFIX="http://${RESOLVED_DOMAIN}:${MCP_GATEWAY_PORT}"
# Use the domain directly (like Claude does) - Squid ACLs properly match domain names
URL_PREFIX="http://${MCP_GATEWAY_DOMAIN}:${MCP_GATEWAY_PORT}"

# Create the TOML configuration
cat > /tmp/gh-aw/mcp-config/config.toml << 'TOML_EOF'
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ const DefaultGitHubMCPServerVersion Version = "v0.30.3"
const DefaultFirewallVersion Version = "v0.13.4"

// DefaultMCPGatewayVersion is the default version of the MCP Gateway (gh-aw-mcpg) Docker image
const DefaultMCPGatewayVersion Version = "v0.0.98"
const DefaultMCPGatewayVersion Version = "v0.0.99"

// DefaultMCPGatewayContainer is the default container image for the MCP Gateway
const DefaultMCPGatewayContainer = "ghcr.io/github/gh-aw-mcpg"
Expand Down
2 changes: 1 addition & 1 deletion pkg/constants/constants_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ func TestVersionConstants(t *testing.T) {
{"DefaultCopilotVersion", DefaultCopilotVersion, "0.0.402"},
{"DefaultCodexVersion", DefaultCodexVersion, "0.94.0"},
{"DefaultGitHubMCPServerVersion", DefaultGitHubMCPServerVersion, "v0.30.3"},
{"DefaultMCPGatewayVersion", DefaultMCPGatewayVersion, "v0.0.98"},
{"DefaultMCPGatewayVersion", DefaultMCPGatewayVersion, "v0.0.99"},
{"DefaultSandboxRuntimeVersion", DefaultSandboxRuntimeVersion, "0.0.34"},
{"DefaultFirewallVersion", DefaultFirewallVersion, "v0.13.4"},
{"DefaultPlaywrightMCPVersion", DefaultPlaywrightMCPVersion, "0.0.63"},
Expand Down
1 change: 0 additions & 1 deletion pkg/workflow/domains.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ var CopilotDefaultDomains = []string{

// CodexDefaultDomains are the minimal default domains required for Codex CLI operation
var CodexDefaultDomains = []string{
"172.30.0.1", // AWF gateway IP - Codex resolves host.docker.internal to this IP for Rust DNS compatibility
"api.openai.com",
"host.docker.internal",
"openai.com",
Expand Down
17 changes: 8 additions & 9 deletions pkg/workflow/domains_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ func TestCopilotDefaultDomains(t *testing.T) {
func TestCodexDefaultDomains(t *testing.T) {
// Verify that expected Codex domains are present
expectedDomains := []string{
"172.30.0.1", // AWF gateway IP - Codex resolves host.docker.internal to this IP
"api.openai.com",
"host.docker.internal",
"openai.com",
Expand Down Expand Up @@ -287,8 +286,8 @@ func TestGetCodexAllowedDomains(t *testing.T) {
t.Run("nil network permissions returns only defaults", func(t *testing.T) {
result := GetCodexAllowedDomains(nil)
// Should contain default Codex domains, sorted
if result != "172.30.0.1,api.openai.com,host.docker.internal,openai.com" {
t.Errorf("Expected '172.30.0.1,api.openai.com,host.docker.internal,openai.com', got %q", result)
if result != "api.openai.com,host.docker.internal,openai.com" {
t.Errorf("Expected 'api.openai.com,host.docker.internal,openai.com', got %q", result)
}
})

Expand All @@ -298,8 +297,8 @@ func TestGetCodexAllowedDomains(t *testing.T) {
}
result := GetCodexAllowedDomains(network)
// Should contain both default Codex domains and user-specified domain
if result != "172.30.0.1,api.openai.com,example.com,host.docker.internal,openai.com" {
t.Errorf("Expected '172.30.0.1,api.openai.com,example.com,host.docker.internal,openai.com', got %q", result)
if result != "api.openai.com,example.com,host.docker.internal,openai.com" {
t.Errorf("Expected 'api.openai.com,example.com,host.docker.internal,openai.com', got %q", result)
}
})

Expand All @@ -309,8 +308,8 @@ func TestGetCodexAllowedDomains(t *testing.T) {
}
result := GetCodexAllowedDomains(network)
// api.openai.com should not appear twice
if result != "172.30.0.1,api.openai.com,example.com,host.docker.internal,openai.com" {
t.Errorf("Expected '172.30.0.1,api.openai.com,example.com,host.docker.internal,openai.com', got %q", result)
if result != "api.openai.com,example.com,host.docker.internal,openai.com" {
t.Errorf("Expected 'api.openai.com,example.com,host.docker.internal,openai.com', got %q", result)
}
})

Expand All @@ -320,8 +319,8 @@ func TestGetCodexAllowedDomains(t *testing.T) {
}
result := GetCodexAllowedDomains(network)
// Empty allowed list should still return Codex defaults
if result != "172.30.0.1,api.openai.com,host.docker.internal,openai.com" {
t.Errorf("Expected '172.30.0.1,api.openai.com,host.docker.internal,openai.com', got %q", result)
if result != "api.openai.com,host.docker.internal,openai.com" {
t.Errorf("Expected 'api.openai.com,host.docker.internal,openai.com', got %q", result)
}
})
}
Expand Down
Loading