a593 phases 5b–5f shipped
AI tab is now server-backed, scoped, and polished. 2026-08-13.
5b · Server-side conversations 6 endpoints
POST/api/mavis/ai/conversations
GET/api/mavis/ai/conversations?thread_id=N
GET/api/mavis/ai/conversations/:id
PATCH/api/mavis/ai/conversations/:id
POST/api/mavis/ai/conversations/:id/messages
DELETE/api/mavis/ai/conversations/:id
- 2 new tables:
hq_ai_conversations, hq_ai_messages (FK cascade)
- SPA swaps localStorage → API. Convos survive refresh, work across devices
- Per-thread scoped (only your thread, or admin id 7)
- Auto-titles from first user message (replaces "New conversation")
5c · Toast polish live
- Slide-in animation from right
- Click anywhere to dismiss (X button + body click)
- 8s auto-dismiss with smooth opacity fade
5d · Action chips live
- 6 chip types wired:
open_artifact, open_plan, open_opinion, file_plan, star, reply_thread
- Click chip → switch to right tab + show toast
- 11px meta line:
1234ms · 87 tok · cached
5e · Workspace chip live
- Clickable dropdown with 24 thread options from
/api/mavis/threads
- Selected scope persisted to localStorage
ai_scope
/api/mavis/ai/ask now uses selected scope (was hardcoded mavis-hq)
5f · Settings modal live
- Provider dropdown (MiniMax / OpenAI / Anthropic)
- Endpoint + model inputs (saved to localStorage)
- Test connection button (live ask: "say hi in 5 words")
- Clear cache button (DELETE
/api/mavis/ai/cache)
- Read-only server config display (key, endpoint, model, cache stats)
- Note: API key is server-side only — change in
/opt/operator/.env
Verification
POST /api/mavis/ai/conversations → c-1786620285731-guiigk
GET /api/mavis/ai/conversations → 1 conversation
GET /api/mavis/ai/conversations/:id → 2 messages
DELETE /api/mavis/ai/conversations/:id → cleaned up
Commits 5a → 5b-5f
850ec43feat(ai): a593 phase 5a — AI tab in SPA (14th tab)
1556fa2feat(ai): a593 phase 2 — wakeup.ai_summary in /me
330fe78feat(ai): /api/mavis/ai/ask + cache + status endpoints
a081fa4feat(ai): a593 phase 5b-5f — server conversations, workspace chip, settings modal, chip handlers