Skip to content

ECHO-375 Get reply error handling llm#252

Merged
ussaama merged 12 commits intomainfrom
get-reply-error-handling-llm
Jul 31, 2025
Merged

ECHO-375 Get reply error handling llm#252
ussaama merged 12 commits intomainfrom
get-reply-error-handling-llm

Conversation

@ussaama
Copy link
Copy Markdown
Contributor

@ussaama ussaama commented Jul 30, 2025

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.

ussaama added 2 commits July 30, 2025 08:44
- 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
@linear
Copy link
Copy Markdown

linear bot commented Jul 30, 2025

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Jul 30, 2025

Walkthrough

This 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

Cohort / File(s) Change Summary
Echo Error Alert UI
echo/frontend/src/components/participant/EchoErrorAlert.tsx
Adds the EchoErrorAlert React component for displaying ECHO-specific errors using Mantine UI and i18n.
Participant Conversation Error Handling
echo/frontend/src/routes/participant/ParticipantConversation.tsx
Integrates error detection and display logic for chat errors, rendering EchoErrorAlert when needed. Imports the new component.
Backend Error Handling and Streaming
echo/server/dembrane/api/conversation.py, echo/server/dembrane/reply_utils.py
Updates error message prefix in streaming responses; adds/refactors exception handling and logging in reply generation for robustness and clarity, including explicit handling of ContentPolicyViolationError.
Localization: New Error Messages & Source Reference Updates
echo/frontend/src/locales/en-US.po, echo/frontend/src/locales/de-DE.po, echo/frontend/src/locales/es-ES.po, echo/frontend/src/locales/fr-FR.po, echo/frontend/src/locales/nl-NL.po
Adds new translation entries for Echo error messages; updates source code line references for existing entries.
Localization: No-op JSON/TS Reserialization
echo/frontend/src/locales/en-US.ts, echo/frontend/src/locales/de-DE.ts, echo/frontend/src/locales/es-ES.ts, echo/frontend/src/locales/fr-FR.ts, echo/frontend/src/locales/nl-NL.ts
Replaces locale message files with functionally identical content (formatting/whitespace only); no change to translation data or exported entities.

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
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15 minutes

Assessment against linked issues

Objective Addressed Explanation
Handle ContentPolicyError in Get reply (ECHO-375) The backend explicitly catches ContentPolicyViolationError and streams a specific error message; frontend displays this error with a dedicated alert component.

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
No out-of-scope changes detected.

Possibly related PRs

  • get reply changes #178: Modifies token counting and model config in generate_reply_for_conversation; related as it touches the same function but focuses on different aspects than this PR's error handling enhancements.

Suggested labels

Feature

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between ea5522b and 783dd51.

📒 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
🔇 Additional comments (4)
echo/server/dembrane/reply_utils.py (4)

5-5: LGTM!

Solid imports for proper error tracking and content policy handling.

Also applies to: 9-9


157-162: Clean formatting improvements.

Also applies to: 179-189, 224-232, 302-314, 337-341


365-385: Proper error handling for LLM calls. LGTM!

Good separation of content policy violations from general errors. Re-raising ensures proper error propagation.


401-455: LGTM! Streaming error handling is on point.

Proper error capture during async streaming with context and re-raising.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch get-reply-error-handling-llm

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need 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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Copy Markdown
Member

@spashii spashii left a comment

Choose a reason for hiding this comment

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

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.
cursor[bot]

This comment was marked as outdated.

- 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.
@coderabbitai coderabbitai bot added the bug Something isn't working label Jul 31, 2025
Copy link
Copy Markdown
Contributor

@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: 3

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 46b2c24 and 5517fa5.

📒 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.ts
  • echo/frontend/src/locales/fr-FR.po
  • echo/frontend/src/locales/nl-NL.po
  • echo/frontend/src/locales/de-DE.po
  • echo/frontend/src/locales/en-US.po
  • echo/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.ts
  • echo/frontend/src/locales/fr-FR.po
  • echo/frontend/src/locales/es-ES.po
  • echo/frontend/src/locales/nl-NL.po
  • echo/frontend/src/locales/de-DE.po
  • echo/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.po
  • echo/frontend/src/locales/es-ES.po
  • echo/frontend/src/locales/nl-NL.po
  • echo/frontend/src/locales/de-DE.po
  • echo/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.po
  • echo/frontend/src/locales/nl-NL.po
  • echo/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 ignore

The participant.echo.error.message block is correctly marked with #~ and will be skipped by lingui extract/compile. Nothing else to action here.


2098-2110: New explicit-ID error messages look good

Both participant.echo.generic.error.message and participant.echo.content.policy.violation.error.message have 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 synced

Verification script ran across *.po files and found both participant.echo.generic.error.message and participant.echo.content.policy.violation.error.message entries 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 solid

The 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 do

The 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 JSX

The fresh IDs participant.echo.generic.error.message and participant.echo.content.policy.violation.error.message are 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.message reads 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.message is clear and idiomatic; accurately conveys the provider-policy block. Ship it.


51-55: Update dependent locale mappings before removing participant.echo.error.message

The key is still referenced in your compiled locale files. Dropping it from the .po will 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 .po entry.

⛔ 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.message and participant.echo.generic.error.message perfectly mirror the English originals, placeholders intact. Nice one.

Copy link
Copy Markdown
Contributor

@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: 1

📜 Review details

Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 3db43e9 and ea5522b.

📒 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.

cursor[bot]

This comment was marked as outdated.

@ussaama ussaama requested review from spashii and removed request for spashii July 31, 2025 13:32
@ussaama ussaama added this pull request to the merge queue Jul 31, 2025
Merged via the queue into main with commit a68beb5 Jul 31, 2025
12 checks passed
@ussaama ussaama deleted the get-reply-error-handling-llm branch July 31, 2025 13:37
spashii pushed a commit that referenced this pull request Nov 18, 2025
<!-- 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 -->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working Feature improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants