Built-in chat UI (streaming, per-user persisted, inline write confirmations) #53

Open
opened 2026-06-14 19:52:05 +00:00 by james · 0 comments
Owner

Streaming text chat panel in the PWA, talking to the built-in agent. Conversations persisted per user. Write-tool confirmations rendered inline as a diff/preview the user can accept or reject.

Scope

  • Chat panel UI in the PWA (placement and styling per the theme system). Streaming text rendering as tokens arrive.
  • Server-side agent loop: receives the user message + conversation history, calls the configured provider, handles tool-call rounds against the tool registry, returns streamed text. Implementation per the agent-runtime ADR.
  • Conversation persistence: conversations + messages tables (or whichever shape the ADR specifies). User-scoped via FK.
  • Write-tool confirmation rendering: when the agent proposes a change, the proposed-change object renders as a diff/preview card inline in the chat. Confirm calls the commit endpoint; reject discards the proposal.
  • Settings panel for provider configuration (provider, API key, optional model override). Stored per the ADR's choice on key handling.
  • Cross-engine tests: conversation create → message append → tool round → commit, on both SQLite and Postgres.

Acceptance criteria

  • A user can open the chat panel, send a message, and see the agent's reply stream in.
  • When the agent proposes a write, the user sees a diff/preview; confirming applies the change via the commit endpoint; rejecting discards it.
  • Conversations persist across sessions and are scoped per user (user B never sees user A's threads).
  • Tests run on both DB engines.

Part of epic #47. Depends on the agent-runtime ADR, the Domain tool surface, and the Audit log + undo ticket (the commit path writes the audit log).

Streaming text chat panel in the PWA, talking to the built-in agent. Conversations persisted per user. Write-tool confirmations rendered inline as a diff/preview the user can accept or reject. ## Scope - Chat panel UI in the PWA (placement and styling per the theme system). Streaming text rendering as tokens arrive. - Server-side agent loop: receives the user message + conversation history, calls the configured provider, handles tool-call rounds against the tool registry, returns streamed text. Implementation per the agent-runtime ADR. - Conversation persistence: `conversations` + `messages` tables (or whichever shape the ADR specifies). User-scoped via FK. - Write-tool confirmation rendering: when the agent proposes a change, the proposed-change object renders as a diff/preview card inline in the chat. Confirm calls the commit endpoint; reject discards the proposal. - Settings panel for provider configuration (provider, API key, optional model override). Stored per the ADR's choice on key handling. - Cross-engine tests: conversation create → message append → tool round → commit, on both SQLite and Postgres. ## Acceptance criteria - [ ] A user can open the chat panel, send a message, and see the agent's reply stream in. - [ ] When the agent proposes a write, the user sees a diff/preview; confirming applies the change via the commit endpoint; rejecting discards it. - [ ] Conversations persist across sessions and are scoped per user (user B never sees user A's threads). - [ ] Tests run on both DB engines. Part of epic #47. Depends on the agent-runtime ADR, the Domain tool surface, and the Audit log + undo ticket (the commit path writes the audit log).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
james/carol#53
No description provided.