Skip to content

feat: show error details on failed messages and fix RAG retry status#799

Merged
larryro merged 2 commits into
mainfrom
feat/chat-error-details-and-rag-retry-fix
Mar 16, 2026
Merged

feat: show error details on failed messages and fix RAG retry status#799
larryro merged 2 commits into
mainfrom
feat/chat-error-details-and-rag-retry-fix

Conversation

@larryro
Copy link
Copy Markdown
Collaborator

@larryro larryro commented Mar 16, 2026

Summary

  • Display inline error details for failed assistant messages in chat, fetched via a new getMessageError Convex query
  • Fix RAG retry action to properly update document status (queued/failed) and schedule polling on success
  • Add isFailed state to message processing to distinguish failed messages with content from aborted ones

Test plan

  • Send a message that triggers an assistant failure — verify error details appear inline below the message
  • Retry RAG indexing on a document — verify status updates to "queued" on success and "failed" on error
  • Verify aborted messages (no content) still show the existing aborted UI, not the error detail

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Failed chat messages now display error details directly in the message bubble.
    • Improved error tracking and recovery for document operations with automatic status checks.
  • Bug Fixes

    • Enhanced error extraction and reporting for failed operations.

…tracking

Display inline error details for failed assistant messages in chat and
update RAG document status correctly on retry success/failure.
Copy link
Copy Markdown

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your free trial has ended. If you'd like to continue receiving code reviews, you can add a payment method here.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Mar 16, 2026

📝 Walkthrough

Walkthrough

This PR implements end-to-end error handling for failed chat messages across the stack. On the backend, it introduces a new getMessageError Convex query that retrieves error details from failed assistant responses, and enhances RAG document action handling with explicit status tracking ('queued', 'failed') and improved error extraction. On the frontend, it adds an isFailed flag to messages, creates a useMessageError hook to fetch error details from the server, and renders error information within the message bubble component. A translation key is added for displaying error details in the UI.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Possibly related PRs

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title clearly summarizes the two main changes: showing error details on failed messages and fixing RAG retry status. It is concise, specific, and directly reflects the core objectives.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/chat-error-details-and-rag-retry-fix
📝 Coding Plan
  • Generate coding plan for human review comments

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

📥 Commits

Reviewing files that changed from the base of the PR and between 7aa03b1 and e7ba652.

⛔ Files ignored due to path filters (1)
  • services/platform/convex/_generated/api.d.ts is excluded by !**/_generated/**
📒 Files selected for processing (7)
  • services/platform/app/features/chat/components/message-bubble.tsx
  • services/platform/app/features/chat/components/message-bubble/types.ts
  • services/platform/app/features/chat/hooks/queries.ts
  • services/platform/app/features/chat/hooks/use-message-processing.ts
  • services/platform/convex/documents/actions.ts
  • services/platform/convex/threads/get_message_error.ts
  • services/platform/messages/en.json

Comment thread services/platform/app/features/chat/components/message-bubble.tsx
Comment thread services/platform/app/features/chat/hooks/use-message-processing.ts
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.
@larryro larryro merged commit fe84a99 into main Mar 16, 2026
17 checks passed
@larryro larryro deleted the feat/chat-error-details-and-rag-retry-fix branch March 16, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant