Conversation
- add a new frontend error component for "Echo" button errors
- add a new frontend error component for "Echo" button errors - add translation for the new component
WalkthroughThis change introduces a new error alert component for the ECHO feature in the frontend, integrates error display logic into the participant conversation view, and enhances backend error handling and logging for conversation replies. Localization files are updated to include new error messages and adjust source references. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant EchoErrorAlert
participant ParticipantConversationAudioRoute
participant BackendAPI
User->>ParticipantConversationAudioRoute: Initiate ECHO conversation
ParticipantConversationAudioRoute->>BackendAPI: Request reply
BackendAPI-->>ParticipantConversationAudioRoute: Stream reply or error (with prefix)
alt Error occurs
ParticipantConversationAudioRoute->>EchoErrorAlert: Render error alert with localized message
EchoErrorAlert-->>User: Display error, suggest retry or support
else Success
ParticipantConversationAudioRoute-->>User: Display conversation reply
end
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~15 minutes Assessment against linked issues
Assessment against linked issues: Out-of-scope changes
Possibly related PRs
Suggested labels
Note ⚡️ Unit Test Generation is now available in beta!Learn more here, or try it out under "Finishing Touches" below. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (4)📓 Common learnings📚 Learning: when working with directus api in this codebase, foreign key relationships must be specified using n...Applied to files:
📚 Learning: in the echo project, the conversation tags feature is designed with an implicit limit of 100 tags pe...Applied to files:
📚 Learning: litellm transcription with whisper models always returns a response with a "text" field, making addi...Applied to files:
🔇 Additional comments (4)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
spashii
left a comment
There was a problem hiding this comment.
split recoverable and unrecoverable messages
- Updated EchoErrorAlert component to accept an error prop and display a tailored message for content policy violations. - Modified ParticipantConversation to pass the error to EchoErrorAlert. - Added logging for content policy violations in reply_utils and conversation API to improve error tracking.
- Updated EchoErrorAlert component to display error messages with a smaller text size for better readability. - Integrated Sentry error tracking in reply_utils to capture exceptions during conversation reply generation and streaming processes, improving overall error monitoring.
There was a problem hiding this comment.
Actionable comments posted: 3
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (10)
echo/frontend/src/locales/de-DE.po(33 hunks)echo/frontend/src/locales/de-DE.ts(1 hunks)echo/frontend/src/locales/en-US.po(33 hunks)echo/frontend/src/locales/en-US.ts(1 hunks)echo/frontend/src/locales/es-ES.po(33 hunks)echo/frontend/src/locales/es-ES.ts(1 hunks)echo/frontend/src/locales/fr-FR.po(33 hunks)echo/frontend/src/locales/fr-FR.ts(1 hunks)echo/frontend/src/locales/nl-NL.po(33 hunks)echo/frontend/src/locales/nl-NL.ts(1 hunks)
🧰 Additional context used
🧠 Learnings (5)
📓 Common learnings
Learnt from: spashii
PR: Dembrane/echo#142
File: echo/frontend/src/lib/query.ts:680-696
Timestamp: 2025-05-13T15:20:25.165Z
Learning: In the Echo project, the conversation tags feature is designed with an implicit limit of 100 tags per conversation. Having more than 100 tags indicates a misuse of the feature rather than a limitation that needs to be addressed in the code. Errors for exceeding this limit should be handled at a logical level above the implementation.
Learnt from: ussaama
PR: Dembrane/echo#224
File: echo/frontend/src/components/report/CreateReportForm.tsx:97-155
Timestamp: 2025-07-17T15:57:51.321Z
Learning: In echo/frontend/src/components/report/CreateReportForm.tsx, the conversation status section should only be displayed when there are pending conversations (conversationCounts.pending !== 0). When all conversations are processed, no status information should be shown to keep the UI minimal and clean.
Learnt from: ussaama
PR: Dembrane/echo#205
File: echo/frontend/src/lib/query.ts:1444-1506
Timestamp: 2025-07-10T12:48:20.683Z
Learning: ussaama prefers string concatenation over template literals for simple cases where readability is clearer, even when linting tools suggest template literals. Human readability takes precedence over strict linting rules in straightforward concatenation scenarios.
Learnt from: ussaama
PR: Dembrane/echo#250
File: echo/frontend/src/components/form/MarkdownWYSIWYG/styles.css:1618-1624
Timestamp: 2025-07-29T11:36:23.638Z
Learning: ussaama prefers to keep CSS vendor prefixes and fallbacks without linter ignore comments, even when linters flag them as duplicate properties. Browser compatibility through progressive enhancement takes precedence over strict linting rules in their workflow.
📚 Learning: in the french localization file (fr-fr.po), "dembrane echo" is intentionally translated as "echo dem...
Learnt from: ussaama
PR: Dembrane/echo#169
File: echo/frontend/src/locales/fr-FR.po:521-523
Timestamp: 2025-05-30T15:36:40.131Z
Learning: In the French localization file (fr-FR.po), "Dembrane Echo" is intentionally translated as "Echo Dembrane" for better French language flow and natural sound. This is not an error but a deliberate localization choice.
Applied to files:
echo/frontend/src/locales/fr-FR.tsecho/frontend/src/locales/fr-FR.poecho/frontend/src/locales/nl-NL.poecho/frontend/src/locales/de-DE.poecho/frontend/src/locales/en-US.poecho/frontend/src/locales/de-DE.ts
📚 Learning: in echo/frontend/src/components/report/createreportform.tsx, the conversation status section should ...
Learnt from: ussaama
PR: Dembrane/echo#224
File: echo/frontend/src/components/report/CreateReportForm.tsx:97-155
Timestamp: 2025-07-17T15:57:51.321Z
Learning: In echo/frontend/src/components/report/CreateReportForm.tsx, the conversation status section should only be displayed when there are pending conversations (conversationCounts.pending !== 0). When all conversations are processed, no status information should be shown to keep the UI minimal and clean.
Applied to files:
echo/frontend/src/locales/en-US.tsecho/frontend/src/locales/fr-FR.poecho/frontend/src/locales/es-ES.poecho/frontend/src/locales/nl-NL.poecho/frontend/src/locales/de-DE.poecho/frontend/src/locales/en-US.po
📚 Learning: .po files (gettext internationalization files) are auto-generated by i18n tools like @lingui/cli and...
Learnt from: ussaama
PR: Dembrane/echo#205
File: echo/frontend/src/locales/nl-NL.po:1246-1247
Timestamp: 2025-07-10T12:47:06.269Z
Learning: .po files (gettext internationalization files) are auto-generated by i18n tools like @lingui/cli and should not be manually edited. The format of component paths and line numbers in these files is determined by the tool configuration, not manually written. Do not suggest manual edits to .po files.
Applied to files:
echo/frontend/src/locales/fr-FR.poecho/frontend/src/locales/es-ES.poecho/frontend/src/locales/nl-NL.poecho/frontend/src/locales/de-DE.poecho/frontend/src/locales/en-US.po
📚 Learning: when users indicate they have already addressed translation issues in locale files, verify the curre...
Learnt from: ussaama
PR: Dembrane/echo#180
File: echo/frontend/src/locales/es-ES.ts:1-1
Timestamp: 2025-06-06T05:43:44.935Z
Learning: When users indicate they have already addressed translation issues in locale files, verify the current state before assuming the issue persists. Translation files are often updated in bulk and previously flagged English text may have been properly localized.
Applied to files:
echo/frontend/src/locales/fr-FR.poecho/frontend/src/locales/nl-NL.poecho/frontend/src/locales/en-US.po
🧬 Code Graph Analysis (3)
echo/frontend/src/locales/nl-NL.ts (1)
echo/frontend/src/locales/en-US.ts (1)
messages(1-1)
echo/frontend/src/locales/en-US.ts (4)
echo/frontend/src/locales/de-DE.ts (1)
messages(1-1)echo/frontend/src/locales/fr-FR.ts (1)
messages(1-1)echo/frontend/src/locales/es-ES.ts (1)
messages(1-1)echo/frontend/src/locales/nl-NL.ts (1)
messages(1-1)
echo/frontend/src/locales/es-ES.ts (1)
echo/frontend/src/locales/en-US.ts (1)
messages(1-1)
🔇 Additional comments (14)
echo/frontend/src/locales/de-DE.ts (1)
1-1: LGTM! Clean localization additions for error handling.The German translations for the new echo error messages are solid. These keys perfectly align with handling ContentPolicyError scenarios from the LLM provider. The translations are contextually appropriate and follow the existing pattern. Ship it! 🚀
echo/frontend/src/locales/es-ES.po (2)
51-55: Obsolete entry retained – safe to ignoreThe
participant.echo.error.messageblock is correctly marked with#~and will be skipped bylingui extract/compile. Nothing else to action here.
2098-2110: New explicit-ID error messages look goodBoth
participant.echo.generic.error.messageandparticipant.echo.content.policy.violation.error.messagehave accurate Spanish translations and follow the explicit-ID pattern used elsewhere in the file. No issues detected. LGTM.echo/frontend/src/locales/en-US.ts (1)
1-1: LGTM! Clean error handling messages for the Echo feature.The new locale keys perfectly address the PR objectives for handling LLM content policy violations. The messages provide clear user guidance with proper escalation paths and maintain consistency with the existing codebase patterns.
echo/frontend/src/locales/de-DE.po (1)
2094-2106: New Echo error messages – all locales syncedVerification script ran across
*.pofiles and found bothparticipant.echo.generic.error.messageandparticipant.echo.content.policy.violation.error.messageentries in every locale. No missing msgids detected. 🚀 LGTM!echo/frontend/src/locales/nl-NL.po (2)
110-111: LGTM! Automated line number updates look solid 🚀These line number adjustments are exactly what we'd expect from the i18n extraction tool doing its thing after source code changes. The tool's automatically keeping the source references in sync - textbook 100x automation right there.
Also applies to: 118-119, 146-148, 328-330, 502-503, 598-599, 821-823, 1010-1012, 1093-1095, 1151-1153, 1185-1186, 1279-1281, 1424-1425, 1488-1490, 1551-1553, 1632-1634, 1654-1655, 1717-1718, 1785-1787, 1994-1997, 2077-2078, 2132-2134, 2352-2354, 2366-2367, 2436-2438, 2493-2495, 2661-2662, 2747-2748, 2901-2903, 2908-2910
51-54: New Echo error translations ship-ready 🎯These Dutch translations for the Echo error handling are clean and professional. The generic error message properly includes retry instructions with HTML formatting for the ECHO button, and the content policy violation message directly addresses the LLM provider restrictions mentioned in the PR objectives. Grammar and context are spot-on for Dutch speakers.
Perfect addition to support the new error handling UX flow.
Also applies to: 313-316, 322-325
echo/frontend/src/locales/es-ES.ts (1)
1-1: 👍 New error-message keys look solidThe three new keys are correctly translated, placeholders (
<0>…</0>) are intact, and the tone matches existing strings. LGTM.echo/frontend/src/locales/en-US.po (2)
51-55: Auto-generated obsolete entry — nothing to doThe entry is correctly marked
#~as obsolete after renaming the message ID. No manual edits required.
2160-2172: New Echo error strings look solid – just verify tag placeholders in JSXThe fresh IDs
participant.echo.generic.error.messageandparticipant.echo.content.policy.violation.error.messageare clear and future-proof.
The<0>…</0>placeholder is still present, so make sure the consuming<Trans>call supplies exactly one React element in its children array; otherwise you’ll hit a runtime placeholder-count mismatch.
No other issues spotted.echo/frontend/src/locales/fr-FR.po (3)
2098-2101: New generic Echo-error translation LGTM
participant.echo.generic.error.messagereads well in French and faithfully mirrors the English source. No further action.
2107-2110: Content-policy violation message translation LGTM
participant.echo.content.policy.violation.error.messageis clear and idiomatic; accurately conveys the provider-policy block. Ship it.
51-55: Update dependent locale mappings before removingparticipant.echo.error.messageThe key is still referenced in your compiled locale files. Dropping it from the
.powill break lookups at runtime. Please update or remove its usage in these files first:
- echo/frontend/src/locales/fr-FR.ts
- echo/frontend/src/locales/es-ES.ts
- echo/frontend/src/locales/en-US.ts
Once the code and JSON message imports no longer reference
participant.echo.error.message, you can safely delete the obsolete.poentry.⛔ Skipped due to learnings
Learnt from: ussaama PR: Dembrane/echo#169 File: echo/frontend/src/locales/fr-FR.po:521-523 Timestamp: 2025-05-30T15:36:40.131Z Learning: In the French localization file (fr-FR.po), "Dembrane Echo" is intentionally translated as "Echo Dembrane" for better French language flow and natural sound. This is not an error but a deliberate localization choice.Learnt from: ussaama PR: Dembrane/echo#205 File: echo/frontend/src/locales/nl-NL.po:1246-1247 Timestamp: 2025-07-10T12:47:06.269Z Learning: .po files (gettext internationalization files) are auto-generated by i18n tools like @lingui/cli and should not be manually edited. The format of component paths and line numbers in these files is determined by the tool configuration, not manually written. Do not suggest manual edits to .po files.Learnt from: ussaama PR: Dembrane/echo#180 File: echo/frontend/src/locales/es-ES.ts:1-1 Timestamp: 2025-06-06T05:43:44.935Z Learning: When users indicate they have already addressed translation issues in locale files, verify the current state before assuming the issue persists. Translation files are often updated in bulk and previously flagged English text may have been properly localized.echo/frontend/src/locales/nl-NL.ts (1)
1-1: Translations added for echo errors – LGTM
participant.echo.error.messageandparticipant.echo.generic.error.messageperfectly mirror the English originals, placeholders intact. Nice one.
There was a problem hiding this comment.
Actionable comments posted: 1
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (1)
echo/server/dembrane/reply_utils.py(10 hunks)
🧰 Additional context used
🧠 Learnings (4)
📓 Common learnings
Learnt from: spashii
PR: Dembrane/echo#142
File: echo/frontend/src/lib/query.ts:680-696
Timestamp: 2025-05-13T15:20:25.165Z
Learning: In the Echo project, the conversation tags feature is designed with an implicit limit of 100 tags per conversation. Having more than 100 tags indicates a misuse of the feature rather than a limitation that needs to be addressed in the code. Errors for exceeding this limit should be handled at a logical level above the implementation.
Learnt from: ussaama
PR: Dembrane/echo#224
File: echo/frontend/src/components/report/CreateReportForm.tsx:97-155
Timestamp: 2025-07-17T15:57:51.321Z
Learning: In echo/frontend/src/components/report/CreateReportForm.tsx, the conversation status section should only be displayed when there are pending conversations (conversationCounts.pending !== 0). When all conversations are processed, no status information should be shown to keep the UI minimal and clean.
Learnt from: ussaama
PR: Dembrane/echo#205
File: echo/frontend/src/lib/query.ts:1444-1506
Timestamp: 2025-07-10T12:48:20.683Z
Learning: ussaama prefers string concatenation over template literals for simple cases where readability is clearer, even when linting tools suggest template literals. Human readability takes precedence over strict linting rules in straightforward concatenation scenarios.
Learnt from: ussaama
PR: Dembrane/echo#250
File: echo/frontend/src/components/form/MarkdownWYSIWYG/styles.css:1618-1624
Timestamp: 2025-07-29T11:36:23.638Z
Learning: ussaama prefers to keep CSS vendor prefixes and fallbacks without linter ignore comments, even when linters flag them as duplicate properties. Browser compatibility through progressive enhancement takes precedence over strict linting rules in their workflow.
📚 Learning: when working with directus api in this codebase, foreign key relationships must be specified using n...
Learnt from: spashii
PR: Dembrane/echo#142
File: echo/frontend/src/lib/query.ts:730-740
Timestamp: 2025-05-13T15:18:29.107Z
Learning: When working with Directus API in this codebase, foreign key relationships must be specified using nested objects with `id` properties (e.g., `conversation_id: { id: conversationId } as Conversation`) rather than direct ID values, even though this appears redundant.
Applied to files:
echo/server/dembrane/reply_utils.py
📚 Learning: in the echo project, the conversation tags feature is designed with an implicit limit of 100 tags pe...
Learnt from: spashii
PR: Dembrane/echo#142
File: echo/frontend/src/lib/query.ts:680-696
Timestamp: 2025-05-13T15:20:25.165Z
Learning: In the Echo project, the conversation tags feature is designed with an implicit limit of 100 tags per conversation. Having more than 100 tags indicates a misuse of the feature rather than a limitation that needs to be addressed in the code. Errors for exceeding this limit should be handled at a logical level above the implementation.
Applied to files:
echo/server/dembrane/reply_utils.py
📚 Learning: litellm transcription with whisper models always returns a response with a "text" field, making addi...
Learnt from: ArindamRoy23
PR: Dembrane/echo#128
File: echo/server/dembrane/transcribe.py:45-55
Timestamp: 2025-05-05T19:39:05.113Z
Learning: LiteLLM transcription with Whisper models always returns a response with a "text" field, making additional KeyError handling unnecessary.
Applied to files:
echo/server/dembrane/reply_utils.py
⏰ 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). (2)
- GitHub Check: Cursor Bugbot
- GitHub Check: ci-check-server
🔇 Additional comments (4)
echo/server/dembrane/reply_utils.py (4)
3-12: LGTM!Clean imports. ContentPolicyViolationError from litellm.exceptions is the right choice for handling Azure's content policy violations.
152-158: Skip pure formatting changes
361-381: Solid error handling for LLM calls!Perfect separation of ContentPolicyViolationError from general exceptions. Sentry integration looks good - this addresses the past review comment about logging through Sentry.
397-451: LGTM on streaming error handling!Wrapping the entire streaming loop in try-except ensures we catch any failures during response processing. Good call on maintaining the conversation ID in the error context.
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an error alert in the participant conversation interface displaying clear messages for Echo-related errors, including content policy violations. * Introduced localized error messages for Echo errors with translations in English, German, Spanish, French, and Dutch. * **Bug Fixes** * Improved error handling during chat interactions to provide timely user notifications. * **Refactor** * Enhanced backend error handling and logging for increased robustness and observability. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary by CodeRabbit
New Features
Bug Fixes
Refactor