macOS proxy bypass entries with IPv6 CIDR (fe80::/10, fc00::/7) are injected verbatim into agent NO_PROXY and crash httpx-based agents (AGENT_EXECUTION_FAILED / "json-rpc id 2: Internal error")
Summary
When the macOS system proxy bypass list ("Bypass proxy settings for these hosts & domains") contains IPv6 CIDR entries such as fe80::/10 or fc00::/7 (commonly added by Clash/Mihomo-style tools for TUN bypass routing), every agent run spawned by the desktop app fails immediately with:
json-rpc id 2: Internal error
error_code: AGENT_EXECUTION_FAILEDExample run: trace_id/run_id 5706244c-43a7-47f1-935d-d2a5e99cdabc, agent_id: kimi, project_id: 6851ef1e-c77e-4edf-824f-27690adfeae3.
Root cause (fully traced)
The daemon reads the macOS system proxy via
scutil --proxyand injectsHTTP_PROXY/HTTPS_PROXY/NO_PROXYinto the spawned agent's environment (parseMacosScutilProxyOutput/finalizeSystemProxyEnvin the platform package). The scutilExceptionsListtokens are passed through intoNO_PROXYverbatim, including entries that are not valid hostnames, e.g.:ExceptionsList : { ..., fe80::/10, ..., fc00::/7, ... }The spawned agent (here Kimi CLI 1.49.0, Python) builds an
httpxclient withtrust_env=True(via the OpenAI SDK). httpx'sget_environment_proxies()(httpx/_utils.py) converts eachNO_PROXYtoken into a proxy-mount URL patternall://*<token>and parses it withhttpx.URL.For CIDR/IPv6 tokens this parse fails and raises
httpx.InvalidURL:>>> import httpx >>> httpx.URL("all://*fe80::/10") httpx.InvalidURL: Invalid port: ':' >>> httpx.URL("all://*[::1]") # bracketed IPv6 from the "<local>" expansion also breaks httpx.InvalidURL: Invalid port: ':1]'The Kimi ACP server catches the exception during
session/new/session/promptand returns JSON-RPC-32603 Internal errorto Open Design, which marks the runAGENT_EXECUTION_FAILED. The run'sevents.jsonlcontains the smoking gun:{"event":"error","data":{"message":"json-rpc id 2: Internal error", "error":{"code":"AGENT_EXECUTION_FAILED","retryable":false, "details":{"details":"Invalid port: ':'"}}}}
Reproduction
On a Mac with the system proxy enabled, add fe80::/10 to the proxy bypass list (System Settings → Network → Details → Proxies), then start any run with a Python/httpx-based agent (kimi). The run dies within ~1 s.
Minimal repro of the injected-environment failure, independent of the desktop app:
HTTP_PROXY=http://127.0.0.1:1082 HTTPS_PROXY=http://127.0.0.1:1082 \
NO_PROXY="localhost,127.0.0.1,fe80::/10,fc00::/7,[::1]" \
python3 -c "import httpx; httpx.Client(trust_env=True)"
# => httpx.InvalidURL: Invalid port: ':'With a clean NO_PROXY=localhost,127.0.0.1,::1 the same agent works fine (verified by driving kimi acp over stdio manually).
Why users can't just remove those entries
fe80::/10 / fc00::/7 in the bypass list are intentional for users running TUN-mode proxy tools (link-local / ULA traffic must bypass the proxy), and the tools re-add them automatically. Telling users to delete them is not a durable workaround.
Suggested fixes
- Sanitize
NO_PROXYbefore injecting it into agent environments (the one-line-class fix): drop tokens that are CIDR ranges (/), bracketed/unbracketed IPv6 literals, or anything that is not a valid hostname/domain/wildcard token.buildNoProxyValue()/finalizeSystemProxyEnv()is the natural place. - Surface the real error: the daemon already receives
details: "Invalid port: ':'"in the ACP error payload — showing it in the UI (or in the run diagnostics block) instead of onlyjson-rpc id 2: Internal errorwould have made this a 5-minute diagnosis. - Optionally: note in docs that httpx-based agents inherit proxy env vars, so malformed
NO_PROXYentries are fatal to them.
Environment
- Open Design desktop, macOS (arm64), namespace
release-stable - Agent: Kimi Code CLI 1.49.0 (
kimi acp, ACP protocol v1) - System proxy:
127.0.0.1:1082with bypass list containingfe80::/10,fc00::/7,*.local, etc.
Source: nexu-io/open-design