From c8b23720dfbc1480d8c81b36d136a9593c52464e Mon Sep 17 00:00:00 2001 From: Ahmed Allam <49919286+0xallam@users.noreply.github.com> Date: Tue, 23 Sep 2025 20:41:23 -0700 Subject: [PATCH] Fix tool server http requests issues (#37) --- strix/runtime/docker_runtime.py | 4 ++-- strix/tools/executor.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/strix/runtime/docker_runtime.py b/strix/runtime/docker_runtime.py index eef88fc..9b6bcb5 100644 --- a/strix/runtime/docker_runtime.py +++ b/strix/runtime/docker_runtime.py @@ -320,7 +320,7 @@ class DockerRuntime(AbstractRuntime): import httpx try: - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(trust_env=False) as client: response = await client.post( f"{api_url}/register_agent", params={"agent_id": agent_id}, @@ -337,7 +337,7 @@ class DockerRuntime(AbstractRuntime): container = self.client.containers.get(container_id) container.reload() - host = "localhost" + host = "127.0.0.1" if "DOCKER_HOST" in os.environ: docker_host = os.environ["DOCKER_HOST"] if "://" in docker_host: diff --git a/strix/tools/executor.py b/strix/tools/executor.py index 1ea15db..d69033a 100644 --- a/strix/tools/executor.py +++ b/strix/tools/executor.py @@ -62,7 +62,7 @@ async def _execute_tool_in_sandbox(tool_name: str, agent_state: Any, **kwargs: A "Content-Type": "application/json", } - async with httpx.AsyncClient() as client: + async with httpx.AsyncClient(trust_env=False) as client: try: response = await client.post( request_url, json=request_data, headers=headers, timeout=None