Skip to content

Conversation

@devin-ai-integration
Copy link
Contributor

@devin-ai-integration devin-ai-integration bot commented Dec 11, 2025

feat(listener): emit error events for stream errors and timeouts

Summary

Adds error event emissions for transcription stream errors and timeouts to enable UI feedback when actor errors occur. This allows the frontend to display meaningful error messages when WebSocket streams fail.

Changes:

  • Emit SessionErrorEvent::ConnectionError for StreamError events (with is_retryable: false)
  • Emit SessionErrorEvent::ConnectionError for StreamTimeout events (with is_retryable: false)
  • Use display formatting ({}) instead of debug formatting ({:?}) for cleaner error messages in connection failures

Updates since last revision

Resolved merge conflicts with main branch. The upstream had already introduced SessionErrorEvent with ConnectionError and AudioError variants, so this PR now uses those existing event types rather than adding a custom Error variant. The emit_session_error helper function was removed in favor of using the upstream event structure directly.

Review & Testing Checklist for Human

  • Verify error events are emitted - The new emissions for StreamError and StreamTimeout should surface to the frontend
  • Check is_retryable: false is correct - Stream errors/timeouts are marked as non-retryable; confirm this matches expected behavior
  • Test with network disconnection - Disconnect network during an active session and verify stream error is emitted with user-friendly message

Recommended test plan:

  1. Start a transcription session and simulate a network failure mid-stream
  2. Verify the frontend receives a SessionErrorEvent::ConnectionError with the stream error details
  3. Confirm the error message uses display formatting (not debug formatting with extra quotes/escapes)

Notes

  • The diff is small after merge conflict resolution - main changes are adding error emissions for stream errors/timeouts
  • Field reordering in SourceState is cosmetic (session_id before app) - no functional change
  • E2E tests failed due to missing desktop binary (pre-existing repo setup issue, not related to this PR)

Link to Devin run: https://app.devin.ai/sessions/c2bf0e6b0059480ca52d1cb1f244502a
Requested by: yujonglee (@yujonglee)

- Add Error variant to SessionEvent enum with session_id, error_type, message, and context fields
- Emit error events for WebSocket connection failures (timeout, connection failed)
- Emit error events for stream errors and timeouts
- Emit error events for audio device failures (mic/speaker open, stream setup, resample)
- Add emit_session_error helper function to reduce code duplication
- Use e.to_string() instead of format!("{:?}", e) for user-facing error context

This enables the UI to provide feedback on Actor status, so users know when
things like websocket connections fail due to wrong API keys or other issues.

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration
Copy link
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment and CI monitoring

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


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

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for hyprnote ready!

Name Link
🔨 Latest commit 9cff03a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote/deploys/6951033a6be7d10008bf8455
😎 Deploy Preview https://deploy-preview-2215--hyprnote.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for hyprnote-storybook ready!

Name Link
🔨 Latest commit 9cff03a
🔍 Latest deploy log https://app.netlify.com/projects/hyprnote-storybook/deploys/6951033a46d29300086642c1
😎 Deploy Preview https://deploy-preview-2215--hyprnote-storybook.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Resolved conflicts by adopting the new event structure:
- SessionErrorEvent::ConnectionError for WebSocket errors
- SessionErrorEvent::AudioError for audio device errors
- Removed custom SessionEvent::Error variant
- Fixed duplicate app field in SourceState

Co-Authored-By: yujonglee <yujonglee.dev@gmail.com>
@devin-ai-integration devin-ai-integration bot changed the title feat(listener): add Error variant to SessionEvent for UI feedback feat(listener): emit error events for stream errors and timeouts Dec 28, 2025
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