| 23-brainstormer-flow |
01 |
api, chat-service |
| express |
| drizzle |
| chat |
| handoff |
| issue-creation |
| system-messages |
|
| requires |
provides |
affects |
| phase |
provides |
| 23-00 |
messageType column in chat_messages, handoffSchema validator |
|
| phase |
provides |
| 21-chat-foundation |
chatService, chatRoutes, addMessage, getConversation |
|
|
| addSystemMessage helper in chatService |
| messageType support in addMessage |
| POST /conversations/:id/handoff route |
| POST /conversations/:id/status-update route |
|
| server/src/services/chat.ts |
| server/src/routes/chat.ts |
|
|
| added |
patterns |
|
|
| addSystemMessage encapsulates system-role message insertion with typed messageType |
| handoff route creates 3 artifacts atomically (handoff msg, issue, task_created msg) |
| companyId resolved from conversation row — not passed in request body |
|
|
| created |
modified |
| server/src/services/chat.ts |
| server/src/routes/chat.ts |
|
|
|
| Import issueService from ../services/issues.js directly (not via index.js) — matches plan guidance and local instantiation pattern used in heartbeat.ts |
| issueSvc instantiated inside chatRoutes(db) — option (a) from plan, simplest approach |
| Handoff content uses arrow character (→) in system message; spec fields assembled into markdown description |
|
| AGENT-03 |
| AGENT-06 |
| AGENT-07 |
| CHAT-09 |
|
| duration |
completed_date |
tasks_completed |
files_changed |
| 8 minutes |
2026-04-01 |
2 |
2 |
|