From 2f143c71422fcbe1047365a4a7b36c5b31e631ec Mon Sep 17 00:00:00 2001 From: claude Date: Wed, 27 May 2026 17:17:00 -0400 Subject: [PATCH] fix(smolmachines): include per-bottle alias in NO_PROXY MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit claude's HTTPS_PROXY was catching the supervise MCP URL (`http://:/`) because NO_PROXY was hardcoded to `localhost,127.0.0.1` and didn't include the per-bottle loopback alias. Claude proxied the MCP POST through egress, egress had no route for the alias, and the connection failed โ€” `/mcp` showed "supervise ยท โœ˜ failed" inside the bottle. Append the loopback alias to NO_PROXY in launch.py so direct MCP calls bypass the proxy. The git-gate URL uses `git://`, which proxies don't touch, so this only affects MCP / HTTP paths to the bundle. Co-Authored-By: Claude Opus 4.7 --- claude_bottle/backend/smolmachines/launch.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/claude_bottle/backend/smolmachines/launch.py b/claude_bottle/backend/smolmachines/launch.py index b3b3498..7bafedc 100644 --- a/claude_bottle/backend/smolmachines/launch.py +++ b/claude_bottle/backend/smolmachines/launch.py @@ -170,10 +170,22 @@ def launch( # Stamp the URLs onto the plan + guest_env. provision_git # and provision_supervise read the plan fields; the agent # reads guest_env on every exec_claude. + # + # NO_PROXY has to include the per-bottle loopback alias โ€” + # otherwise claude's HTTPS_PROXY catches direct calls to + # the supervise URL (`http://:/`) and proxies + # them through egress, which has no route for the alias + # and rejects with "Failed to connect". The git-gate URL + # uses git://, not affected by HTTP_PROXY, so the alias + # only has to be in NO_PROXY for the MCP / supervise + # path. Append rather than overwrite so prepare.py's + # `localhost,127.0.0.1` baseline stays in place. + existing_no_proxy = plan.guest_env.get("NO_PROXY", "localhost,127.0.0.1") guest_env = { **plan.guest_env, "HTTPS_PROXY": agent_proxy_url, "HTTP_PROXY": agent_proxy_url, + "NO_PROXY": f"{existing_no_proxy},{loopback_ip}", } if agent_git_gate_host: guest_env["GIT_GATE_URL"] = f"git://{agent_git_gate_host}"