Skip to content

Enable host-gateway setup for explicit Ollama host domains - #8172

Merged
lpcox merged 5 commits into
mainfrom
copilot/ollama-fix-misconfiguration
Sep 5, 2026
Merged

Enable host-gateway setup for explicit Ollama host domains#8172
lpcox merged 5 commits into
mainfrom
copilot/ollama-fix-misconfiguration

Conversation

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Ollama workflows targeting host.docker.internal were allowlisted but did not trigger AWF’s host-gateway setup, preventing sandboxed agents from reaching the host Ollama service.

  • Extend host-gateway keyword processing to recognize:
    • host.docker.internal
    • http://host.docker.internal
    • https://host.docker.internal
  • Preserve explicit host-domain entries while enabling container host access.
  • Add focused coverage for Ollama’s custom port configuration.
{
  "network": {
    "allowDomains": ["host.docker.internal"]
  },
  "security": {
    "allowHostPorts": ["11434"]
  }
}

Copilot AI linked an issue Sep 5, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Fix misconfiguration issue with ollama Enable host-gateway setup for explicit Ollama host domains Sep 5, 2026
Copilot AI requested a review from lpcox September 5, 2026 15:44
@lpcox
lpcox marked this pull request as ready for review September 5, 2026 16:43
Copilot AI balanced review requested due to automatic review settings September 5, 2026 16:43

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.

🟡 Changes recommended

Explicit host domains incorrectly trigger localhost-to-host gateway remapping.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Extends host-gateway detection for Ollama configurations using host.docker.internal.

Changes:

  • Recognizes explicit host-domain variants.
  • Preserves explicit entries and custom ports.
  • Adds focused parser coverage.
File summaries
File Description
src/parsers/dns-parsers.ts Extends host-gateway keyword processing.
src/parsers/dns-parsers.test.ts Tests explicit Ollama host configuration.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Balanced

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

Comment on lines +62 to +64
d === 'host.docker.internal' ||
d === 'http://host.docker.internal' ||
d === 'https://host.docker.internal'
@lpcox

lpcox commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

@copilot rebase onto main and address review feedback

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot rebase onto main and address review feedback

Addressed in d3932d1. I merged main into the branch (rather than rebasing, since this environment cannot force-push rewritten history) and separated explicit host-gateway detection from localhostDetected.

@github-actions

github-actions Bot commented Sep 5, 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.

@lpcox

lpcox commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Copilot AI commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix the failing ci check https://github.com/github/gh-aw-firewall/actions/runs/33979824141/job/101344113836?pr=8172

Fixed in 9a63be8. The failing type-check fixture now includes hostGatewayDetected, and npm run type-check passes locally.

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

✅ Coverage Check Passed

Overall Coverage

Metric Base PR Delta
Lines 93.99% 94.01% 📈 +0.02%
Statements 92.62% 92.63% ➡️ +0.01%
Functions 93.33% 93.33% ➡️ +0.00%
Branches 86.38% 86.41% 📈 +0.03%
📁 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 Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK completed. Copilot BYOK mode operational. 🔓

🔑 BYOK report filed by Smoke Copilot BYOK

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🛡️ Smoke Copilot Network Isolation confirmed the egress allowlist is enforced. ✅

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Contribution Check completed successfully!

PR #8172 follows the listed contribution guidelines: it includes focused tests for the new host-gateway behavior, keeps files in the correct src/ layout, and the PR description references the related issue. No comment needed.

Generated by Contribution Check for #8172

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

📡 OTel tracing validated by Smoke OTel Tracing

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🔌 Smoke Services — All services reachable! ✅

🔌 Service connectivity validated by Smoke Services

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

📰 BREAKING: Report filed by Smoke Docker Sbx

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (Entra) completed. Copilot AOAI BYOK (Entra) mode operational. 🔓

🪪 BYOK (AOAI Entra) report filed by Smoke Copilot BYOK AOAI (Entra)

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

📰 BREAKING: Report filed by Smoke Copilot

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Claude failed

Warning

Firewall blocked 1 domain

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

  • api.anthropic.com

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

network:
  allowed:
    - defaults
    - "api.anthropic.com"

See Network Configuration for more information.

Generated by Smoke Claude for #8172

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

🔮 The oracle has spoken through Smoke Codex

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Gemini reports failed. Facets need polishing...

💎 Faceted by Smoke Gemini

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Build Test Suite completed successfully!

Generated by Build Test Suite for #8172

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Copilot BYOK AOAI (api-key) completed. Copilot AOAI BYOK (api-key) mode operational. 🔓

Smoke test failed: GitHub MCP live result mismatch; review required

🔑 BYOK (AOAI api-key) report filed by Smoke Copilot BYOK AOAI (api-key)

@lpcox
lpcox deployed to aoai-model September 5, 2026 17:53 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🚀 Security Guard has started processing this pull request

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

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

Tested by Smoke Chroot

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

EGRESS_RESULT allow=pass deny=pass

✅ Allowed domain (github.com) reachable: allowed=200
✅ Non-allowed domain (example.com) blocked: CONNECT tunnel failed, response 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 added the smoke-copilot-network-isolation Copilot network-isolation egress smoke test label Sep 5, 2026
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot BYOK (Direct) Mode ✅

Status: PASS

All tests passed. Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY via api-proxy → api.githubcopilot.com).

  • ✅ GitHub MCP (list_pull_requests verified)
  • ✅ github.com connectivity (HTTP 200)
  • ✅ File write/read test
  • ✅ BYOK inference test (you're reading this response)

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: Copilot Engine — Overall: PASS

Recent merged PRs: #8171 "Shrink Squid negative DNS TTL to stop caching transient SERVFAILs", #8166 "Upgrade gh-aw to latest pre-release"

cc @lpcox

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke test results:

  • Redis PING: ❌ (Could not connect: Temporary failure in name resolution)
  • PostgreSQL pg_isready: ❌ (no response)
  • PostgreSQL SELECT 1: ❌ (could not translate host name)

Overall: FAILhost.docker.internal did not resolve; sandbox could not reach host service containers.

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Chroot Version Comparison

Runtime Host Version Chroot Version Match?
Python Python 3.12.14 Python 3.12.14 ✅ YES
Node.js v24.20.0 v2.98.0 ❌ NO
Go go1.22.12 go1.22.12 ✅ YES

Overall: FAILED — Node.js version mismatch between host and chroot environments. smoke-chroot label not applied since not all tests passed.

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

@Copilot @lpcox
Smoke Test Results:

  1. GitHub MCP Testing: ❌
  2. GitHub.com Connectivity: ✅
  3. File Write/Read Test: ✅
  4. BYOK Inference Test: ✅
    Running in direct BYOK mode (COPILOT_PROVIDER_API_KEY + COPILOT_PROVIDER_BASE_URL) via api-proxy → Azure OpenAI (Foundry, o4-mini-aw)
    Overall: FAIL

🔑 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 Sep 5, 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 (run OK) ✅ PASS
.NET json-parse N/A (run 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: required using -Dmaven.repo.local pointed at a writable directory since ~/.m2/repository wasn't creatable under the default HOME; all other config (proxy settings.xml) worked as documented.
  • No clone failures; all 8 test repositories cloned successfully.

Generated by Build Test Suite for #8172 · copilot · auto · 34.6 AIC · ⊞ 12K ·
Add label ready-for-aw to run again

@lpcox
lpcox deployed to aoai-model September 5, 2026 17:59 — with GitHub Actions Active
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Smoke Test: API Proxy OTel Tracing — Results

  • Scenario 1 (Module Loading):otel.js loads successfully. isEnabled()true. Exports: startRequestSpan, setTokenAttributes, setBudgetAttributes, endSpan, endSpanError, shutdown, isEnabled, _parseEndpoints, _parseOtlpHeaders, _buildResourceSpans, _createOtlpWorkloadIdentity, plus internal exporter classes.
  • Scenario 2 (Test Suite): ✅ 3 suites / 68 tests passed (otel.test.js, otel-fanout.test.js, otel-workload-identity.test.js), 0 failures.
  • Scenario 3 (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, GITHUB_AW_OTEL_PARENT_SPAN_ID to api-proxy.
  • Scenario 4 (Token Tracker Integration):token-tracker-http.js implements the onUsage callback (OTEL hook point), invoked after normalized usage extraction.
  • Scenario 5 (OTEL Diagnostics): ✅ 1 span exported for this run (gh-aw.agent.setup, workflow-level trace context correctly propagated with traceId/parentSpanId). No gen_ai.usage.* spans present, as expected — no proxied LLM API calls occurred during this smoke run to generate api-proxy request spans.

Overall: All 5 scenarios pass. Graceful degradation confirmed (no errors when OTEL not fully exercised); tracing infrastructure is functioning correctly end-to-end for available signals.

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

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

Enable host-gateway setup for explicit Ollama host domains

  • GitHub MCP Testing: ❌
  • GitHub.com Connectivity: ✅
  • File Write/Read: ✅
  • BYOK Inference: ✅

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
Overall Status: FAIL

cc @Copilot @lpcox

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

@lpcox
lpcox deployed to aoai-model September 5, 2026 18:00 — with GitHub Actions Active
@lpcox
lpcox merged commit 66ddae4 into main Sep 5, 2026
174 of 182 checks passed
@lpcox
lpcox deleted the copilot/ollama-fix-misconfiguration branch September 5, 2026 22:40
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.

Ollama

3 participants