feat: show error details on failed messages and fix RAG retry status#799
Conversation
…tracking Display inline error details for failed assistant messages in chat and update RAG document status correctly on retry success/failure.
There was a problem hiding this comment.
Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.
📝 WalkthroughWalkthroughThis PR implements end-to-end error handling for failed chat messages across the stack. On the backend, it introduces a new Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@services/platform/app/features/chat/components/message-bubble.tsx`:
- Around line 203-207: The UI currently renders raw errorDetails when
message.isFailed but doesn't use the new translation key; update the
MessageBubble rendering to prepend the localized label from
tChat('errorDetails') before the error text (e.g., "Error details:
{errorDetails}") so the translation is used, ensuring to keep existing classes
like "text-destructive mt-2 text-xs break-all" and the conditional that checks
message.isFailed && errorDetails; alternatively remove the unused
chat.errorDetails key if you intentionally want the raw message.
In `@services/platform/app/features/chat/hooks/use-message-processing.ts`:
- Around line 250-251: The returned message object in use-message-processing.ts
now includes an isFailed property but the ChatMessage interface lacks that
field; update the ChatMessage interface to declare isFailed (use type boolean,
or boolean | undefined if you prefer optionality) so the interface matches the
objects produced (add isFailed: boolean or isFailed?: boolean to the ChatMessage
interface declaration).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: a9f4ab4c-412e-4255-b89b-847aa543b7b7
⛔ Files ignored due to path filters (1)
services/platform/convex/_generated/api.d.tsis excluded by!**/_generated/**
📒 Files selected for processing (7)
services/platform/app/features/chat/components/message-bubble.tsxservices/platform/app/features/chat/components/message-bubble/types.tsservices/platform/app/features/chat/hooks/queries.tsservices/platform/app/features/chat/hooks/use-message-processing.tsservices/platform/convex/documents/actions.tsservices/platform/convex/threads/get_message_error.tsservices/platform/messages/en.json
Add authentication check to getMessageError query to prevent unauthenticated access. Wrap RAG retry status update in try/catch to avoid masking the original error. Add accessibility attributes and label to error details display in message bubble.
Summary
getMessageErrorConvex queryisFailedstate to message processing to distinguish failed messages with content from aborted onesTest plan
🤖 Generated with Claude Code
Summary by CodeRabbit
New Features
Bug Fixes