Skip to content

Commit 7dacaac

Browse files
docs(agents): note Vite IPv4 bind and Spring CORS loopback hosts
Cloud VM gotchas: Vite can bind ::1-only without --host 0.0.0.0, and CORS_ALLOWED_ORIGINS must include both localhost and 127.0.0.1 for Agent. Co-authored-by: Venkat SF <venkatesh.sakamuri@stayflexi.com>
1 parent 8a62e31 commit 7dacaac

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,10 @@ only covers cloud-specific, non-obvious caveats.
177177
Redis degrades gracefully but the local `.env` points at it.
178178
- **Backend** (port 8080, base path `/api`): `bash scripts/start-backend.sh` (wraps
179179
`./mvnw spring-boot:run`; it strips `SPRING_PROFILES_ACTIVE=prod` for local runs → dev mode).
180-
- **Frontend** (port 3000): `npm run dev` (Vite proxies `/api` → 8080 and `/agent-api` → 8787).
180+
- **Frontend** (port 3000): prefer `npx vite --host 0.0.0.0 --port 3000` (or `npm run dev`
181+
with `server.host` set). Plain `npm run dev` can bind **IPv6-only** (`::1:3000`) in this
182+
VM so `curl http://127.0.0.1:3000` fails even though Vite looks healthy. Vite proxies
183+
`/api` → 8080 and `/agent-api` → 8787.
181184
- **Hermes Agent webui** (port 8787, optional): needed only for the sidebar **Agent** tab.
182185
See caveats below for install + `HERMES_WEBUI_ALLOWED_ORIGINS`.
183186
- A demo target DB `demo_shop` (same Postgres server, sample `customers`/`products`/`orders`)
@@ -225,6 +228,10 @@ only covers cloud-specific, non-obvious caveats.
225228
`HERMES_WEBUI_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000` or browser
226229
requests via the Vite `/agent-api` proxy return **403** "Cross-origin mismatch".
227230
Webui listens on `:8787`.
231+
- **Spring CORS must allow both loopback hosts.** Set
232+
`CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000` in `.env`. Opening
233+
the UI as `http://127.0.0.1:3000` while only `localhost` is allowlisted yields **403**
234+
on `POST /api/agent/session` (and other cookie-auth APIs).
228235
- **Before running backend tests that boot the Spring context** (e.g. `ApiSmokeTest`), stop
229236
the running backend first — both use `ddl-auto=update` on the same `dba_agent` DB and can
230237
deadlock on an `ALTER TABLE`. Test env vars are documented in `CLAUDE.md` (Testing).

0 commit comments

Comments
 (0)