fix: unblock Smoke Gemini — exclude MCP host env leak, allow api-proxy IP through Squid#2986
Conversation
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 87.89% | 87.83% | 📉 -0.06% |
| Statements | 87.85% | 87.79% | 📉 -0.06% |
| Functions | 83.51% | 83.51% | ➡️ +0.00% |
| Branches | 79.79% | 79.59% | 📉 -0.20% |
📁 Per-file Coverage Changes (2 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/squid-config.ts |
96.9% → 94.1% (-2.81%) | 97.0% → 94.2% (-2.77%) |
src/container-lifecycle.ts |
87.3% → 88.4% (+1.13%) | 87.7% → 88.8% (+1.10%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
There was a problem hiding this comment.
Pull request overview
This PR addresses Smoke Gemini failures by preventing an MCP gateway host-domain env var from leaking into the agent container and by allowing the api-proxy sidecar’s raw IPv4 traffic through Squid (including making api-proxy ports eligible for Safe_ports checks).
Changes:
- Exclude
MCP_GATEWAY_HOST_DOMAINfrom inherited agent environment and from the workflow’s--env-allpassthrough. - Extend Squid config generation to (a) allow the api-proxy sidecar IP before raw-IP deny rules and (b) add api-proxy ports to
Safe_ports. - Update Smoke Gemini workflow allowlists to include
generativelanguage.googleapis.comandaiplatform.googleapis.com.
Show a summary per file
| File | Description |
|---|---|
| src/types/docker.ts | Extends SquidConfig with apiProxyIp and apiProxyPorts inputs. |
| src/squid-config.ts | Generates new Squid ACL/rules for api-proxy IP/ports; adds policy-manifest rule entry. |
| src/services/agent-environment.ts | Adds MCP_GATEWAY_HOST_DOMAIN to excluded env passthrough list. |
| src/container-lifecycle.ts | Passes api-proxy IP/ports into Squid config generation when api-proxy is enabled. |
| .github/workflows/smoke-gemini.md | Adds required Google API domains to network.allowed. |
| .github/workflows/smoke-gemini.lock.yml | Updates locked allowed domains and excludes MCP_GATEWAY_HOST_DOMAIN from --env-all. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 6/6 changed files
- Comments generated: 3
| // the per-IP allow rule (below) has a chance to fire. | ||
| if (apiProxyPorts && apiProxyPorts.length > 0) { | ||
| for (const proxyPort of apiProxyPorts) { | ||
| portAclsSection += `\nacl Safe_ports port ${proxyPort} # AWF api-proxy sidecar`; |
| // --- api-proxy allow (before raw-IP deny) --- | ||
| if (apiProxyIp) { | ||
| rules.push({ | ||
| id: 'allow-api-proxy-ip', | ||
| order: ++order, | ||
| action: 'allow', | ||
| aclName: 'allow_api_proxy_ip', | ||
| protocol: 'both', | ||
| domains: [apiProxyIp], | ||
| description: 'Allow connections to the AWF api-proxy sidecar IP before raw-IP deny rules', | ||
| }); | ||
| } |
| ${apiProxyIp ? ` | ||
| # Allow connections to the AWF api-proxy sidecar before raw-IP deny rules. | ||
| # Some HTTP clients (e.g., Node.js fetch / undici ProxyAgent) route requests to | ||
| # the api-proxy via HTTP_PROXY without honouring NO_PROXY for raw IP addresses, | ||
| # causing them to arrive at Squid and be rejected by the raw-IP deny rule below. | ||
| # This allow rule fires first for the known api-proxy IP. | ||
| acl allow_api_proxy_ip dst ${apiProxyIp} | ||
| http_access allow allow_api_proxy_ip | ||
| ` : ''} |
|
@copilot address the review feedback |
All three points addressed in commit
All 1781 tests pass; lint and build clean. |
|
| Metric | Base | PR | Delta |
|---|---|---|---|
| Lines | 87.89% | 87.86% | 📉 -0.03% |
| Statements | 87.85% | 87.81% | 📉 -0.04% |
| Functions | 83.51% | 92.12% | 📈 +8.61% |
| Branches | 79.79% | 79.90% | 📈 +0.11% |
📁 Per-file Coverage Changes (3 files)
| File | Lines (Before → After) | Statements (Before → After) |
|---|---|---|
src/cli.ts |
98.3% → 85.7% (-12.59%) | 98.3% → 85.7% (-12.62%) |
src/squid-config.ts |
96.9% → 97.1% (+0.18%) | 97.0% → 97.2% (+0.17%) |
src/container-lifecycle.ts |
87.3% → 88.4% (+1.13%) | 87.7% → 88.8% (+1.10%) |
Coverage comparison generated by scripts/ci/compare-coverage.ts
Smoke Test✅ Merged PRs: refactor: remove dead re-exports from cli.ts and unexport ExecaMockResult; refactor: fix test import path inconsistency for docker-manager Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "registry.npmjs.org"See Network Configuration for more information.
|
Smoke Test: Copilot BYOK (Offline) Mode
Running in BYOK offline mode ( Overall: PARTIAL — BYOK inference path confirmed working; pre-step data not available for full validation.
|
|
Smoke Test Results ✅ GitHub MCP: 906adff, 35cd74c Overall: PASS
|
🔬 Smoke Test Results — PR #2986
Overall: FAIL — GitHub MCP returned 401 and workflow template variables were not substituted. Actor:
|
Chroot Version Comparison Results
Overall: ❌ Not all versions match. Go matches, but Python and Node.js differ between host and chroot environments.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Smoke Test Results — FAIL
Overall: ❌ FAIL
|
apiProxyPortsvalues insrc/squid-config.tswriteConfigsinsrc/container-lifecycle.tsto passapiProxyIptogeneratePolicyManifest