mirror of
https://github.com/escalante29/WealthySmart.git
synced 2026-07-17 11:28:47 +02:00
Dev: derive AGENT_URL from BACKEND_URL so the assistant works locally
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) <noreply@anthropic.com>
This commit is contained in:
@@ -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"));
|
||||
|
||||
Reference in New Issue
Block a user