fix(proxy): omit bracketed [::1] from child process NO_PROXY
Related Issue
Closes #1931
Description
The bracketed IPv6 loopback [::1] in NO_PROXY is only needed in-process for undici's EnvHttpProxyAgent (which mis-parses a bare ::1 as host : port 1). However, proxyEnvForChild() and reconcileChildNoProxy() were propagating the same value verbatim into child processes (stdio MCP servers).
Python's httpx parses all://[::1] and treats :1] as the port, raising httpx.InvalidURL — crashing any Python-based MCP server when a proxy is configured.
Fix
- Introduce
LOOPBACK_NO_PROXY_CHILD(without[::1]) alongside the existingLOOPBACK_NO_PROXY. - Add
resolveNoProxyForChild()which uses the child-safe loopback list. proxyEnvForChild()andreconcileChildNoProxy()now callresolveNoProxyForChild()instead ofresolveNoProxy().- The in-process
resolveNoProxy()(used bycreateProxyDispatcherfor undici) is unchanged — it still includes[::1].
Applied to both packages/agent-core and packages/agent-core-v2 (identical proxy utilities).
Checklist
- [x] I have read the CONTRIBUTING document.
- [x] I have linked the related issue, if any.
- [x] I have added tests that prove my fix is effective or that my feature works.
- [x] I have run
pnpm changesetto add a changeset. - [x] I have updated user-facing docs in
docs/.
🦋 Changeset detected
Latest commit: cc7deaa2a7e3153e9a897593187c8ed96c9267b9
The changes in this PR will be included in the next version bump.
This PR includes changesets to release 1 package
| Name | Type |
|---|---|
| @moonshot-ai/kimi-code | Patch |
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR