Files
multica/server/migrations/033_chat.down.sql
yushen 50f9e673e8 feat(chat): add agent chat feature (full stack)
Implement the Master Agent chat feature allowing users to chat with agents
directly from a floating window, separate from the issue-based workflow.

Backend:
- New chat_session and chat_message tables (migration 033)
- Make issue_id nullable on agent_task_queue for chat tasks
- REST API: create/list/get/archive sessions, send/list messages
- EnqueueChatTask in TaskService with session_id persistence
- WS events: chat:message, chat:done
- Daemon: chat task type with separate prompt builder
- ClaimTaskByRuntime populates chat context (session, message, repos)

Frontend:
- ChatSession/ChatMessage types + API client methods
- core/chat: TanStack Query options, mutations with optimistic updates, WS updaters
- features/chat: Zustand store, ChatFab (floating button), ChatWindow with
  real-time streaming via task:message events
- Mounted in dashboard layout (bottom-right corner)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 14:19:46 +08:00

11 lines
367 B
SQL

-- Reverse chat feature migration.
ALTER TABLE agent_task_queue DROP COLUMN IF EXISTS chat_session_id;
-- Restore issue_id NOT NULL (remove any rows with NULL issue_id first).
DELETE FROM agent_task_queue WHERE issue_id IS NULL;
ALTER TABLE agent_task_queue ALTER COLUMN issue_id SET NOT NULL;
DROP TABLE IF EXISTS chat_message;
DROP TABLE IF EXISTS chat_session;