From 6307ade4802f999588cf6a18b72def107461fddd Mon Sep 17 00:00:00 2001 From: oliver Date: Sat, 9 May 2026 16:10:40 +0800 Subject: [PATCH] fix(netx-tools): ignore system proxy for netx API calls Set trust_env=False for netx tool HTTP clients so local netx endpoints are called directly instead of via host proxy settings. Co-authored-by: Cursor --- runtime/tools/experts/network_ops/netx_tools.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/runtime/tools/experts/network_ops/netx_tools.py b/runtime/tools/experts/network_ops/netx_tools.py index b15ed564..5f0da45a 100644 --- a/runtime/tools/experts/network_ops/netx_tools.py +++ b/runtime/tools/experts/network_ops/netx_tools.py @@ -69,7 +69,8 @@ def _http_json(method: str, path: str, *, params: dict[str, Any] | None = None) base = _netx_base_url() url = f"{base}{path}" try: - with httpx.Client(timeout=45.0) as client: + # Do not inherit system proxy settings for local netx calls. + with httpx.Client(timeout=45.0, trust_env=False) as client: resp = client.request(method, url, params=params or None, headers=_netx_headers()) text = resp.text if not resp.is_success: @@ -492,7 +493,8 @@ def netx_sql_query_tool() -> ToolSpec: base = _netx_base_url() url = f"{base}/v1/sql/query" try: - with httpx.Client(timeout=60.0) as client: + # Do not inherit system proxy settings for local netx calls. + with httpx.Client(timeout=60.0, trust_env=False) as client: resp = client.post(url, json={"sql": sql, "batch_id": batch_id, "limit": limit}, headers=_netx_headers()) text = resp.text if not resp.is_success: @@ -751,7 +753,8 @@ def netx_sql_query_ume_tool() -> ToolSpec: base = _netx_base_url() url = f"{base}/v1/sql/ume_query" try: - with httpx.Client(timeout=60.0) as client: + # Do not inherit system proxy settings for local netx calls. + with httpx.Client(timeout=60.0, trust_env=False) as client: resp = client.post( url, json={"sql": sql, "limit": limit, "statement_timeout_ms": statement_timeout_ms},