fix(xl-ai): preserve error messages in ClientSideTransport stream#2862
Conversation
Move the "Issue Context" section out of AGENTS.md (which runs on every conversation) and into .claude/skills/github-issues/ so it can be invoked on demand instead.
The AI SDK changed toUIMessageStream()'s default onError to return a generic "An error occurred." instead of the real message (to prevent leaking server details). Since ClientSideTransport runs entirely client-side, explicitly pass onError to surface the original error.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughTwo unrelated changes: the GitHub issue-scanning instructions previously in ChangesGitHub Issue-Scanning Skill Migration
ClientSideTransport Error Normalization
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~4 minutes Poem
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
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. Comment |
Summary
Fixes the AI SDK's
toUIMessageStream()default behavior change that was silently replacing real error messages with a generic "An error occurred." string, and extracts the GitHub issue search instructions from AGENTS.md into a dedicated Claude Code skill.Rationale
The Vercel AI SDK recently changed
toUIMessageStream()'s defaultonErrorto return"An error occurred."instead of the actual error message, to prevent leaking server details to clients. SinceClientSideTransportruns entirely client-side, there is no server-to-client boundary and the original error message should be preserved. This was caught by the Fresh Install Tests CI job.Changes
onErrorcallback totoUIMessageStream()inClientSideTransportthat surfaces the real error messageAGENTS.mdinto.claude/skills/github-issues/SKILL.mdImpact
Error messages from LLM API calls (e.g. rate limit errors) will now be surfaced to users correctly instead of being replaced with a generic message. No breaking changes.
Testing
errorHandling.test.tstest that validates 429 error message propagation — passesChecklist
Summary by CodeRabbit