fix: add api-proxy hostname to NO_PROXY for Node.js undici compatibility#4003
Conversation
Node.js undici matches NO_PROXY entries against the request hostname string, not the resolved IP address. When code fetches http://api-proxy:10000/reflect, undici checks for 'api-proxy' in NO_PROXY — the existing IP entry (172.30.0.30) doesn't match. This caused internal api-proxy traffic to be tunneled through Squid, which rejects it with a 403 since 'api-proxy' isn't in the domain allowlist. Fix: include both the IP and the Docker service hostname in NO_PROXY. Closes #4001 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
✅ Coverage Check PassedOverall Coverage
📁 Per-file Coverage Changes (1 files)
Coverage comparison generated by |
🔬 Smoke Test Results
Overall: PASS Author: @lpcox · Reviewer:
|
Smoke Test: Claude Engine
Result: PASS
|
There was a problem hiding this comment.
Pull request overview
Ensures internal traffic to the api-proxy sidecar bypasses Squid when Node.js (undici) uses hostname-based NO_PROXY matching, preventing CONNECT api-proxy:10000 requests from being rejected by Squid.
Changes:
- Append both the api-proxy IP and the Docker Compose service hostname (
api-proxy) toNO_PROXY/no_proxywhen the api-proxy sidecar is enabled. - Update service configuration tests to assert the hostname is included in both
NO_PROXYandno_proxy.
Show a summary per file
| File | Description |
|---|---|
| src/services/agent-environment/proxy-environment.ts | Adds api-proxy hostname to the agent’s NO_PROXY entries when the api-proxy sidecar is enabled. |
| src/services/api-proxy-service-config.test.ts | Extends existing tests to validate NO_PROXY / no_proxy include both api-proxy IP and hostname. |
Copilot's findings
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 2/2 changed files
- Comments generated: 0
Smoke Test: Copilot BYOK — PASS ✅
Running in BYOK offline mode ( PR author: @lpcox · Reviewer:
|
Chroot Version Comparison Results
Overall: ❌ Not all tests passed — Python and Node.js versions differ between host and chroot environments.
|
Smoke Test Results
Overall: FAIL —
|
This comment has been minimized.
This comment has been minimized.
|
🔮 The ancient spirits stir, and the smoke test agent has passed through the veil. 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.
|
🏗️ Build Test Suite Results
Overall: 8/8 ecosystems passed — ✅ PASS
|
Problem
Node.js undici matches
NO_PROXYentries against the request hostname string, not the resolved IP. When code fetcheshttp://api-proxy:10000/reflect, undici checks forapi-proxyinNO_PROXY— the existing IP entry (172.30.0.30) doesn't match.This caused internal api-proxy traffic to be tunneled through Squid via
CONNECT api-proxy:10000, which Squid rejects (403) sinceapi-proxyisn't in the domain allowlist.Affected: Pi provider and any Node.js runtime that fetches internal api-proxy endpoints by hostname.
Fix
Include both the IP and the Docker service hostname
api-proxyinNO_PROXY:Evidence
From UNDICI debug trace in gh-aw#35381:
curlto the same URL succeeds because it resolves hostname to IP before matchingNO_PROXY.Closes #4001