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")

Author: lodyai[bot]Created Aug 22, 2026Updated Sep 28, 2026
Labelsbughelp wanted

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_FAILED

Example run: trace_id/run_id 5706244c-43a7-47f1-935d-d2a5e99cdabc, agent_id: kimi, project_id: 6851ef1e-c77e-4edf-824f-27690adfeae3.

Root cause (fully traced)

  1. The daemon reads the macOS system proxy via scutil --proxy and injects HTTP_PROXY / HTTPS_PROXY / NO_PROXY into the spawned agent's environment (parseMacosScutilProxyOutput / finalizeSystemProxyEnv in the platform package). The scutil ExceptionsList tokens are passed through into NO_PROXY verbatim, including entries that are not valid hostnames, e.g.:

    ExceptionsList : { ..., fe80::/10, ..., fc00::/7, ... }
  2. The spawned agent (here Kimi CLI 1.49.0, Python) builds an httpx client with trust_env=True (via the OpenAI SDK). httpx's get_environment_proxies() (httpx/_utils.py) converts each NO_PROXY token into a proxy-mount URL pattern all://*<token> and parses it with httpx.URL.

  3. For CIDR/IPv6 tokens this parse fails and raises httpx.InvalidURL:

    python
    >>> 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]'
  4. The Kimi ACP server catches the exception during session/new / session/prompt and returns JSON-RPC -32603 Internal error to Open Design, which marks the run AGENT_EXECUTION_FAILED. The run's events.jsonl contains the smoking gun:

    json
    {"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:

bash
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

  1. Sanitize NO_PROXY before 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.
  2. 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 only json-rpc id 2: Internal error would have made this a 5-minute diagnosis.
  3. Optionally: note in docs that httpx-based agents inherit proxy env vars, so malformed NO_PROXY entries 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:1082 with bypass list containing fe80::/10, fc00::/7, *.local, etc.