Skip to content

Fix cli-proxy ENETUNREACH in network-isolation mode by dual-homing it on the external bridge - #7066

Merged
lpcox merged 3 commits into
mainfrom
copilot/awf-network-isolation-fix
Aug 8, 2026
Merged

Fix cli-proxy ENETUNREACH in network-isolation mode by dual-homing it on the external bridge#7066
lpcox merged 3 commits into
mainfrom
copilot/awf-network-isolation-fix

Conversation

Copilot AI commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

On ubuntu-latest GitHub-hosted runners (no Tailscale, no custom host routing), awf-cli-proxy never becomes healthy in --network-isolation mode when connecting to an external DIFC proxy: the tcp-tunnel dials ENETUNREACH 172.17.0.1:18443, exhausting the DIFC liveness probe and failing the workflow before the agent starts.

Root cause

  • awf-net is created as an internal: true network in network-isolation mode — it has no route out.
  • Squid and api-proxy are already dual-homed onto the external bridge network (awf-ext) so they can reach the internet.
  • cli-proxy was left attached only to the internal awf-net, even though it always sets extra_hosts: { 'host.docker.internal': 'host-gateway' } to reach the external DIFC proxy on the runner host.
  • Without a route to the outside, Docker's host-gateway value falls back to the default bridge's gateway (172.17.0.1), which cli-proxy cannot reach from its isolated network — hence the ENETUNREACH.

Fix

  • src/compose-generator.ts: when networkIsolation is enabled and the cli-proxy service exists, attach it to EXTERNAL_BRIDGE_NAME (awf-ext) in addition to awf-net, matching the existing Squid/api-proxy pattern:
if (config.networkIsolation && services['cli-proxy']) {
  const cliProxyService = services['cli-proxy'];
  cliProxyService.networks = {
    ...(cliProxyService.networks || {}),
    [EXTERNAL_BRIDGE_NAME]: {},
  };
}

This gives host.docker.internal a gateway cli-proxy can actually route to, so the tcp-tunnel to the external DIFC proxy succeeds and the sidecar reports healthy.

Tests

  • src/compose-generator.test.ts: new test asserting cli-proxy is dual-homed on awf-net (with its assigned IP) and awf-ext when networkIsolation is true and difcProxyHost/cliProxyIp are configured.

Copilot AI changed the title [WIP] Fix cli-proxy connectivity issue in network-isolation mode Fix cli-proxy ENETUNREACH in network-isolation mode by dual-homing it on the external bridge Aug 8, 2026
Copilot AI requested a review from lpcox August 8, 2026 00:22
@lpcox
lpcox marked this pull request as ready for review August 8, 2026 00:32
Copilot AI balanced review requested due to automatic review settings August 8, 2026 00:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds host reachability for cli-proxy under network isolation by attaching it to the external bridge.

Changes:

  • Dual-homes cli-proxy on awf-net and awf-ext.
  • Adds unit coverage for the generated topology.
  • Introduces an unrestricted-egress security issue requiring changes.
Show a summary per file
File Description
src/compose-generator.ts Adds the external network attachment.
src/compose-generator.test.ts Verifies both network attachments.

Review details

Tip

Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

Comment thread src/compose-generator.ts Outdated
Comment on lines +187 to +191
if (config.networkIsolation && services['cli-proxy']) {
const cliProxyService = services['cli-proxy'];
cliProxyService.networks = {
...(cliProxyService.networks || {}),
[EXTERNAL_BRIDGE_NAME]: {},
@lpcox

lpcox commented Aug 8, 2026

Copy link
Copy Markdown
Collaborator

@copilot address review feedback

Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>

Copilot AI commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot address review feedback

Addressed in 15cc566: cli-proxy is again internal-only, with regression coverage for the attached DIFC-proxy topology.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

✅ Copilot review passed with no inline comments.

@copilot Add the ready-for-aw label to this PR to trigger agentic CI smoke tests.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 94.09% 94.11% 📈 +0.02%
Statements 93.06% 93.09% 📈 +0.03%
Functions 94.47% 94.47% ➡️ +0.00%
Branches 86.27% 86.29% 📈 +0.02%
📁 Per-file Coverage Changes (1 files)
File Lines (Before → After) Statements (Before → After)
src/log-directory-setup.ts 96.2% → 100.0% (+3.78%) 96.3% → 100.0% (+3.71%)

Coverage comparison generated by scripts/ci/compare-coverage.ts

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation reports failed to deliver outputs while checking network isolation. Investigate the egress model.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Copilot reports failed to deliver outputs. Our correspondents are investigating the incident...

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) reports failed to deliver outputs. AOAI BYOK (Entra) mode investigation needed...

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📡 Smoke OTel Tracing completed. All tracing scenarios validated. ✅

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini completed. All facets verified. 💎

Smoke test completed with FAIL status. Connectivity and PR listing (secrecy) issues encountered.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

✨ The prophecy is fulfilled... Smoke Codex has completed its mystical journey. The stars align. 🌟

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Build Test Failed Build Test Suite - See logs for details

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude failed to deliver outputs

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK reports failed to deliver outputs. BYOK mode investigation needed...

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

No contribution-guideline issues found in PR #7066. The PR description is clear, references the related issue, adds a targeted test, and places changes in the correct source and test files.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Chroot tests passed! Smoke Chroot - All security and functionality tests succeeded.

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) reports failed to deliver outputs. AOAI BYOK (api-key) mode investigation needed...

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📰 DEVELOPING STORY: Smoke Docker Sbx reports failed to deliver outputs. Our correspondents are investigating the incident...

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com): reachable, HTTP 200
✅ Blocked domain (example.com): blocked (CONNECT tunnel 403)

Overall: PASS

cc @lpcox

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • example.com

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "example.com"

See Network Configuration for more information.

🛡️ Egress verdict from Smoke Copilot Network Isolation
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Copilot Engine Smoke Test

Overall: PASS

cc @lpcox

📰 BREAKING: Report filed by Smoke Copilot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Claude Engine Validation

Check Result
API status ✅ PASS
gh check ✅ PASS
File status ✅ PASS

Overall result: PASS

Generated by Smoke Claude for #7066 · haiku45 · 55.2 AIC · ⊞ 6.4K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct Mode) ✅ PASS

  • ✅ GitHub MCP connectivity
  • ✅ GitHub.com HTTP 200
  • ✅ File write/read verified
  • ✅ BYOK inference working (api-proxy → api.githubcopilot.com)

Running in direct BYOK mode via COPILOT_PROVIDER_API_KEY.

🔑 BYOK report filed by Smoke Copilot BYOK
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Redis: ❌ (DNS resolution failure: Temporary failure in name resolution)
PostgreSQL pg_isready: ❌ (no response — host.docker.internal unresolvable)
PostgreSQL SELECT 1: ❌ (could not translate host name)

Overall: FAILhost.docker.internal could not be resolved from within the sandbox.

🔌 Service connectivity validated by Smoke Services
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Gemini Engine Validation

Overall Status: FAIL

💎 Faceted by Smoke Gemini
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

📡 OTel Tracing Smoke Test Results

  • Module Loading: otel.js loaded successfully, isEnabled()true. Exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, _parseEndpoints, _parseOtlpHeaders, _buildResourceSpans, _createOtlpWorkloadIdentity (+ internal exporter classes).
  • Test Suite: 3 suites / 68 tests passed, 0 failed (otel.test.js, otel-fanout.test.js, plus split-module tests).
  • Env Var Forwarding: env-passthrough.ts forwards GITHUB_AW_OTEL_TRACE_ID and GITHUB_AW_OTEL_PARENT_SPAN_ID to the agent; api-proxy-env-config.ts forwards GH_AW_OTLP_ENDPOINTS, OTEL_EXPORTER_OTLP_ENDPOINT, GITHUB_AW_OTEL_TRACE_ID, and GITHUB_AW_OTEL_PARENT_SPAN_ID to api-proxy.
  • Token Tracker Integration: token-tracker-http.js contains the onUsage callback hook point for OTEL.
  • ⚠️ OTEL Diagnostics: No live API traffic occurred in this run, so no otel.jsonl span export file was produced — expected since no LLM requests were routed through api-proxy in this smoke test session.

All core scenarios validated successfully; no regressions detected.

📡 OTel tracing validated by Smoke OTel Tracing
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke test: FAIL
PRs:

  • fix: keep cli-proxy isolated from external bridge
  • fix: dual-home cli-proxy on external bridge in network-isolation mode
    GitHub MCP / safeinputs-gh: ❌
    Playwright: ✅
    File write + cat: ✅
    Discussion query/comment: ❌
    Build (npm ci && npm run build): ✅

Warning

Firewall blocked 1 domain

The following domain was blocked by the firewall during workflow execution:

  • registry.npmjs.org

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "registry.npmjs.org"

See Network Configuration for more information.

🔮 The oracle has spoken through Smoke Codex
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison Results

Runtime Host Version Chroot Version Match?
Python Python 3.12.13 Python 3.12.13 ✅ YES
Node.js v24.18.0 v22.23.2 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version differs between host and chroot environment (v24.18.0 vs v22.23.2). Since not all runtimes matched, the smoke-chroot label was not applied.

Tested by Smoke Chroot
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Found merged PRs: ${{ steps.smoke-data.outputs.SMOKE_PR_DATA }} ✅
GitHub.com connectivity ✅
File write/read ✅
Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) ✅
Overall: PASS
@lpcox

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@lpcox

Add A19/B19 runner doctor entries: ARC/DinD safeoutputs mount + rootless cleanup chmod noise
fix: propagate config fields to all layers

✅ GitHub MCP Testing
✅ GitHub.com Connectivity
✅ File Write/Read Test
✅ BYOK Inference Test

Running in direct BYOK mode (AWF_AUTH_TYPE=github-oidc + AWF_AUTH_AZURE_* + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw) authenticated via Microsoft Entra
Status: PASS

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

🏗️ Build Test Suite Results

Ecosystem Project Build/Install Tests Status
Bun elysia 1/1 passed ✅ PASS
Bun hono 1/1 passed ✅ PASS
C++ fmt N/A ✅ PASS
C++ json N/A ✅ PASS
Deno oak N/A 1/1 passed ✅ PASS
Deno std N/A 1/1 passed ✅ PASS
.NET hello-world N/A (ran OK) ✅ PASS
.NET json-parse N/A (ran OK) ✅ PASS
Go color ok ✅ PASS
Go env ok ✅ PASS
Go uuid ok ✅ PASS
Java gson 1/1 passed ✅ PASS
Java caffeine 1/1 passed ✅ PASS
Node.js clsx passed ✅ PASS
Node.js execa passed ✅ PASS
Node.js p-limit passed ✅ PASS
Rust fd 1/1 passed ✅ PASS
Rust zoxide 1/1 passed ✅ PASS

Overall: 8/8 ecosystems passed — PASS

Notes:

  • Java: Maven's default local repo (~/.m2/repository) was not writable in this environment, so builds used -Dmaven.repo.local=/tmp/gh-aw/agent/m2repo as a workaround. All compiles/tests still succeeded through the configured squid-proxy:3128 HTTP/HTTPS proxy settings.
  • All repositories cloned successfully; no CLONE_FAILED cases.

Generated by Build Test Suite for #7066 · auto · 38.2 AIC · ⊞ 11.5K ·
Add label ready-for-aw to run again

@github-actions

github-actions Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Docker Sbx — cc @lpcox

Overall: PASS

📰 BREAKING: Report filed by Smoke Docker Sbx
Add label ready-for-aw to run again

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

Projects

None yet

3 participants