feat(chat): persist messages to DB via ConversationsRepo (M1-001/002/003) #292

Merged
jason.woltje merged 1 commits from feat/m1-chat-persistence into main 2026-03-21 20:18:06 +00:00
Owner

Summary

  • M1-001: Persist user messages to DB immediately on receipt in
  • M1-002: Accumulate streaming assistant text and persist full response on
  • M1-003: Store metadata on each message: , , (input/output/cache), array,

Auto-creates the conversation row if it does not already exist (the from the WebSocket can be a new UUID).

Closes #291

Test plan

  • Send a user message via WebSocket and verify it appears in table with role=user
  • Verify assistant response is saved after streaming completes (role=assistant)
  • Verify metadata JSON contains model, provider, tokenUsage, toolCalls, timestamp
  • Verify conversation row is auto-created when a new conversationId arrives

🤖 Generated with Claude Code

## Summary - M1-001: Persist user messages to DB immediately on receipt in - M1-002: Accumulate streaming assistant text and persist full response on - M1-003: Store metadata on each message: , , (input/output/cache), array, Auto-creates the conversation row if it does not already exist (the from the WebSocket can be a new UUID). Closes #291 ## Test plan - [ ] Send a user message via WebSocket and verify it appears in table with role=user - [ ] Verify assistant response is saved after streaming completes (role=assistant) - [ ] Verify metadata JSON contains model, provider, tokenUsage, toolCalls, timestamp - [ ] Verify conversation row is auto-created when a new conversationId arrives 🤖 Generated with Claude Code
jason.woltje added 1 commit 2026-03-21 20:17:42 +00:00
feat(chat): persist messages to DB via ConversationsRepo (M1-001/002/003)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful
ef3529a587
Wire ChatGateway to ConversationsRepo so every user message is saved on
receipt (M1-001) and every assistant response is saved on agent:end with
accumulated streaming text (M1-002). Metadata includes model, provider,
tokenUsage (input/output/cache counts), toolCalls array, and timestamp
on each message record (M1-003). Auto-creates the conversation row when
the agent session is new.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
jason.woltje merged commit 5261048d67 into main 2026-03-21 20:18:06 +00:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mosaicstack/stack#292