Skip to content

Fix: surface mid-stream OAuth errors as login chip#216

Open
annzhang-db wants to merge 1 commit into
databricks:mainfrom
annzhang-db:fix-oauth-error-chip
Open

Fix: surface mid-stream OAuth errors as login chip#216
annzhang-db wants to merge 1 commit into
databricks:mainfrom
annzhang-db:fix-oauth-error-chip

Conversation

@annzhang-db
Copy link
Copy Markdown
Contributor

Summary

  • Mid-stream errors (e.g. MCP connection OAuth failures) were forwarded to the client as raw { type: 'error', errorText } chunks
  • The client's message rendering pipeline only processes data-error parts, so these errors were logged but never displayed
  • Converts mid-stream error chunks to { type: 'data-error', data: errorText } so isCredentialErrorMessage can match them and MessageOAuthError renders the login chip

Root cause

stream-fallback.ts had one code path that correctly emitted data-error (in fallbackToGenerateText) but the mid-stream error forwarding path wrote the raw AI SDK error chunk instead. The client ignores type: 'error' chunks entirely.

Test plan

  • Trigger an OAuth-gated MCP tool (e.g. a UC connection requiring GitHub login) — the login chip should appear instead of a silent failure
  • Non-OAuth mid-stream errors should still appear as error messages via the existing MessageError component

This pull request and its description were written by Claude.

…dering

Raw error chunks ({ type: 'error', errorText }) were forwarded as-is to the
client, which only renders data-error parts. This meant OAuth credential errors
never surfaced as the login chip — they were logged but silently dropped by
the client's message rendering pipeline.

Co-authored-by: Ann Zhang
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