feat(chat): add reasoning field to messages and update UI components - #1033
Conversation
- Introduced a new field in the message schema to capture reasoning content from AI models. - Updated the , , and components to handle and display the new reasoning content. - Enhanced the API definitions to include the reasoning field in both request and response structures. - Adjusted the database schema to accommodate the new reasoning field in the messages table. ## Changes ### Core Functionality - Added as a nullable string in the message schema and API definitions. - Updated message handling logic in the chat components to include reasoning content. ### UI Improvements - Modified the layout of chat components to ensure proper display of reasoning alongside messages. ## Test plan - [x] Verify that reasoning content is correctly captured and displayed in the chat interface. - [x] Ensure that existing functionalities remain unaffected by the new changes.
❌ Preview Environment deleted from BunnyshellAvailable commands (reply to this comment):
|
WalkthroughAdds a nullable Changes
Sequence Diagram(s)sequenceDiagram
autonumber
participant User
participant UI as Playground UI
participant API as Chats API
participant DB as Message DB
User->>UI: Open or select chat
UI->>API: GET /chat (request)
API->>DB: SELECT messages (includes reasoning)
DB-->>API: messages (+reasoning)
API-->>UI: messages (+reasoning)
UI->>UI: Reconstruct UI message parts (include reasoning part)
UI->>User: Render messages with reasoning
User->>UI: Send message / assistant reply arrives
UI->>UI: Extract reasoningContent from assistant message
UI->>API: POST /chat/:id/messages { content, reasoning }
API->>DB: INSERT message (includes reasoning)
DB-->>API: inserted message
API-->>UI: created message (includes reasoning)
UI->>User: Display created message with reasoning
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)packages/db/**/*.sql📄 CodeRabbit inference engine (CLAUDE.md)
Files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
🔇 Additional comments (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Changes
Core Functionality
UI Improvements
Test plan
Summary by CodeRabbit
New Features
UI/UX Improvements
Behavioral