From 37c2b1830045f6f03844e088b84d1ee28ad8a95d Mon Sep 17 00:00:00 2001 From: Carlos Escalante Date: Sat, 4 Jul 2026 14:16:25 -0600 Subject: [PATCH] Dev: derive AGENT_URL from BACKEND_URL so the assistant works locally MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The default pointed at the compose-internal 'backend' hostname, which never resolves when the Hono runtime runs on the host — every local agent run died with fetch failed/ENOTFOUND before reaching FastAPI. Prod is unaffected (sets both URLs explicitly). Co-Authored-By: Claude Opus 4.8 (1M context) --- frontend/server.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/server.ts b/frontend/server.ts index 65e20c0..7dc0ee7 100644 --- a/frontend/server.ts +++ b/frontend/server.ts @@ -9,10 +9,12 @@ import { HttpAgent, Middleware, EventType } from "@ag-ui/client"; import { Observable } from "rxjs"; import { Hono } from "hono"; -const AGENT_URL = - process.env.AGENT_URL ?? "http://backend:8000/api/v1/agent/agui"; const BACKEND_URL = process.env.BACKEND_URL ?? "http://localhost:8001"; +// Prod sets AGENT_URL explicitly (compose network); the default derives from +// BACKEND_URL so local dev reaches the docker backend published on :8001. +const AGENT_URL = + process.env.AGENT_URL ?? `${BACKEND_URL}/api/v1/agent/agui`; const isProd = process.env.NODE_ENV === "production"; const PORT = parseInt(process.env.PORT ?? (isProd ? "3000" : "3001"));