From 68c622979b56663bcba08cae7007a2b72d3d9cae Mon Sep 17 00:00:00 2001 From: oliver Date: Sat, 9 May 2026 16:10:34 +0800 Subject: [PATCH] fix(oclaw-bridge): disable system proxy for localhost health calls Set trust_env=False on netx->oclaw analyze and health clients so localhost checks are not routed through host proxies. Co-authored-by: Cursor --- netx_api/ap_client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/netx_api/ap_client.py b/netx_api/ap_client.py index 03b2e6d..e1f77bc 100644 --- a/netx_api/ap_client.py +++ b/netx_api/ap_client.py @@ -23,7 +23,8 @@ def analyze_with_oclaw(payload: dict[str, Any]) -> dict[str, Any]: token = str(settings.oclaw_analyze_token or "").strip() if token: headers["authorization"] = f"Bearer {token}" - with httpx.Client(timeout=_analyze_httpx_timeout()) as client: + # Avoid inheriting system proxy settings for local oclaw bridge calls. + with httpx.Client(timeout=_analyze_httpx_timeout(), trust_env=False) as client: resp = client.post(settings.oclaw_analyze_url, json=payload, headers=headers) text = resp.text if not resp.is_success: @@ -39,7 +40,8 @@ def health_with_oclaw() -> dict[str, Any]: if token: headers["authorization"] = f"Bearer {token}" health_s = max(3.0, float(settings.oclaw_health_timeout_sec)) - with httpx.Client(timeout=health_s) as client: + # Avoid inheriting system proxy settings for local oclaw bridge calls. + with httpx.Client(timeout=health_s, trust_env=False) as client: resp = client.get(settings.oclaw_health_url, headers=headers) status = int(resp.status_code) text = resp.text