Files
VuQuangBao f0fc5e7ecf Drop patient-context prepending and account UI from chat
Personalization context was silently no-op'ing on the first turn of a
fresh session in live testing (profile fetch hadn't resolved by the
time the request fired), so it could not be relied on. Chat now always
sends the user's own text unmodified. Login/profile/admin entry point
removed from the header.
2026-08-25 14:53:43 +07:00
..
2026-08-14 11:57:58 +07:00

web

Next.js frontend: chat UI, citation/evidence panel, drug autocomplete, persistent clinical disclaimer banner.

Current call path: browser → this app's own route handlers → ai-service. api-gateway is not built yet (its directory holds a README.md and a package.json), so requests go through app/api/ and on to ai-service (API_GATEWAY_URL ?? AI_SERVICE_URL, set to http://ai-service:8000 in production). There is no authentication layer in this path today. When the gateway and auth services are built, this is the seam that changes.

app/api/chat/route.ts is more than a proxy: it maps ai-service's abstain reason codes to the Vietnamese text the user reads. A reason code with no entry there falls back to wording that reads as "no data in the formulary", which would misrepresent an outage or a timeout — so a new backend reason code needs an entry here in the same change.

Timeouts: _components/ChatPanel.tsx aborts a request at 65s, derived from the backend's ceiling (a 40s request budget that can overrun by one in-flight model call). A lower value can cut off answers the server has successfully produced, so keep it above that ceiling if it is ever revisited.

Running

pnpm install
pnpm --filter web dev     # http://localhost:3000, expects ai-service on :8079

Tests

There are none, and no test runner is configured. Verify changes by driving the real UI in a browser; pytest passing in apps/ai-service says nothing about this app.