Skip to content

Conversation

@lerouxb
Copy link
Contributor

@lerouxb lerouxb commented Aug 27, 2025

This logs assistant errors like this:

{"t":{"$date":"2025-08-27T10:36:56.587Z"},"s":"E","c":"COMPASS-ASSISTANT","id":1001000370,"ctx":"Assistant","msg":"Failed to send a message","attr":{"err":{"message":"Failed to fetch"}}}

And it shows them in a banner like this:

Screenshot 2025-08-27 at 11 31 03

Banner text is calculated as:

function makeErrorMessage(message: string) {
  message = message || 'An error occurred';
  return `${message}. Try clearing the chat if the error persists.`;
}

Copilot AI review requested due to automatic review settings August 27, 2025 10:39
@lerouxb lerouxb requested a review from a team as a code owner August 27, 2025 10:39
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements error handling for the Assistant feature by adding logging capabilities and user-facing error notifications. The changes enable better debugging through structured logging and improve user experience by displaying error messages in a dismissible banner.

  • Adds error logging to capture assistant failures with structured log messages
  • Implements user-facing error notifications with a dismissible banner component
  • Upgrades the AI SDK version to support enhanced error handling features

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 1 comment.

File Description
packages/compass-assistant/src/compass-assistant-provider.tsx Adds logger dependency and error callback to log assistant failures
packages/compass-assistant/src/assistant-chat.tsx Implements error banner UI with dismissible functionality
packages/compass-assistant/src/@ai-sdk/react/use-chat.ts Exposes clearError function from the chat interface
packages/compass-assistant/package.json Updates AI SDK version from 5.0.5 to 5.0.26

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@lerouxb lerouxb added the feature flagged PRs labeled with this label will not be included in the release notes of the next release label Aug 27, 2025
@lerouxb lerouxb changed the title Assistant errors feat(compass-assistant): handle assistant errors COMPASS-9695 Aug 27, 2025
@github-actions github-actions bot added the feat label Aug 27, 2025
Copy link
Contributor

@gagik gagik left a comment

Choose a reason for hiding this comment

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

check is failing, otherwise LGTM

@lerouxb lerouxb merged commit 3aacb04 into main Aug 27, 2025
53 of 58 checks passed
@lerouxb lerouxb deleted the assistant-errors branch August 27, 2025 13:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat feature flagged PRs labeled with this label will not be included in the release notes of the next release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants