Persisted conversations
The agent detail page's "test the agent" panel keeps history. Each chat is a named conversation, scoped per user, that you can switch between, rename, or delete. Replaces the old stateless prompt box where every turn started fresh.
Layout #
The agent detail page is split into two columns:
- Right pane — full-height chat for the active conversation. Input is sticky at the bottom; assistant turns scroll above. Tool calls render inline as collapsible cards within the assistant's turn.
- Left rail — your conversations for this deployment, most-recent first. + new chat at the top creates an empty conversation.
Empty state on first visit: a single big input that creates the first conversation when you submit.
Titles #
Auto-derived from your first prompt, truncated to ~60 characters. You can rename inline from the rail (click the title; Enter to save, blur to cancel). Renaming only changes the display label — it doesn't re-key the conversation.
Switching, renaming, deleting #
- Switch — click any row in the rail. The right pane reloads with that conversation's history.
- Rename — inline from the row.
- Delete — confirm prompt; deletes the conversation and cascades its messages.
Streaming #
Assistant text streams in token-by-token as the model writes it (epic #179). Tool calls narrate inline as they fire. Final usage stats (iterations, tokens, stop reason) land on the message once the run completes and get persisted to the database.
Schema #
Two tables, both ON DELETE CASCADE from the parent so deleting a
deployment / org / user cleans up automatically.
agent_conversations—id,organization_id,deployment_id,user_id,title,created_at,updated_at. Indexed on(user_id, deployment_id, updated_at DESC)for the rail's most-recent-first query.agent_messages—id,conversation_id,role(user|assistant),content(jsonb, mirrors the SDK'sMessage['content']shape), plus assistant-only telemetry:stop_reason,iterations,input_tokens,output_tokens. Indexed on(conversation_id, created_at).
Privacy #
Conversations are per-user. Org-mates in the same organization running the same agent see their own conversations only — your chat history is yours. Sharing a conversation across users (read-only or collaborative) is a separate epic; not shipped.
Related #
- App shell pattern — the page chrome around the chat.