ADR 0006 — Chat surface: Next.js + assistant-ui with an external store ​
- Status: accepted (2026-09-28). Amended (2026-09-29): the UI is built with shadcn/ui and the pruned assistant-ui registry components, in a feature layout; see ADR 0011. Amended (2026-09-29) by ADR 0012: the runtime becomes
@assistant-ui/react-ag-ui(pinned, patched where needed) instead ofuseExternalStoreRuntime; messages arrive as AG-UI events projected from the event log, and live updates come from the orchestrator's AG-UI connect stream, not a Next.jsLISTEN. Next.js, assistant-ui, thedata-*renderers, the event log as the single source and "no Assistant Cloud" stand. Done (2026-09-29): the web runs on@assistant-ui/react-ag-ui; the external store,to-itemsand the SSE hook are gone, and the renderers are theagui-activity/vymalo.*parts (seeweb/README.md).
Context ​
The chat is not "you ↔ one model". It is a live view of a job: planner, workers, CI and reviewers all post into it, and your replies unblock it.
Decision ​
Next.js with assistant-ui (MIT) using useExternalStoreRuntime: the app owns the messages, assistant-ui renders them.
- Messages come from the job's
eventstable, mapped throughconvertMessage. - Threads come from our own database via a custom
ExternalStoreThreadListAdapter— no Assistant Cloud. - Agent events render as cards: custom
data-*message parts (e.g.{ type: "data-ci-result", data: {…} }) plusmetadatafor the posting agent. onNewturns your message into an inbox event (e.g. answering aBlockedjob);isRunningreflects whether the job is active.- Live updates: Postgres
NOTIFY→ Next.jsLISTEN→ SSE → browser.
Consequences ​
The chat is the job's history — the event log is the single source for both the UI and replay.