Skip to content

fix(xl-ai): preserve error messages in ClientSideTransport stream#2862

Merged
nperez0111 merged 2 commits into
mainfrom
feat/extract-github-search-skill
Jun 18, 2026
Merged

fix(xl-ai): preserve error messages in ClientSideTransport stream#2862
nperez0111 merged 2 commits into
mainfrom
feat/extract-github-search-skill

Conversation

@nperez0111

@nperez0111 nperez0111 commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

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 default onError to return "An error occurred." instead of the actual error message, to prevent leaking server details to clients. Since ClientSideTransport runs 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

  • Pass an explicit onError callback to toUIMessageStream() in ClientSideTransport that surfaces the real error message
  • Extract GitHub issue search instructions from AGENTS.md into .claude/skills/github-issues/SKILL.md

Impact

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

  • Ran the errorHandling.test.ts test that validates 429 error message propagation — passes
  • Full test suite passes (873 tests in integration, 225 in xl-ai)

Checklist

  • Code follows the project's coding standards.
  • Unit tests covering the new feature have been added.
  • All existing tests pass.
  • The documentation has been updated to reflect the new feature

Summary by CodeRabbit

  • Bug Fixes
    • Improved error message handling for streaming text operations, ensuring clearer error information when failures occur.

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.
@vercel

vercel Bot commented Jun 18, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
blocknote Ready Ready Preview Jun 18, 2026 12:22pm
blocknote-website Building Building Preview Jun 18, 2026 12:22pm

Request Review

@nperez0111 nperez0111 merged commit ade62f2 into main Jun 18, 2026
13 of 14 checks passed
@nperez0111 nperez0111 deleted the feat/extract-github-search-skill branch June 18, 2026 12:23
@github-actions

github-actions Bot commented Jun 18, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1

QR code for preview link

🚀 View preview at
https://TypeCellOS.github.io/BlockNote/pr-preview/pr-2862/

Built to branch gh-pages at 2026-06-18 12:32 UTC.
Preview will be ready when the GitHub Pages deployment is complete.

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 346d4444-56c6-4145-b295-02d17d7a9d38

📥 Commits

Reviewing files that changed from the base of the PR and between 27f156a and d72775a.

📒 Files selected for processing (3)
  • .claude/skills/github-issues/SKILL.md
  • AGENTS.md
  • packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts

📝 Walkthrough

Walkthrough

Two unrelated changes: the GitHub issue-scanning instructions previously in AGENTS.md are extracted into a new dedicated Claude skill file at .claude/skills/github-issues/SKILL.md, and ClientSideTransport.streamText gains an explicit onError callback that normalizes streamed errors to strings.

Changes

GitHub Issue-Scanning Skill Migration

Layer / File(s) Summary
GitHub issues skill definition and AGENTS.md cleanup
AGENTS.md, .claude/skills/github-issues/SKILL.md
The "Issue Context" block is removed from AGENTS.md and recreated as a standalone skill with front-matter metadata, when-to-use guidance, and an ordered gh CLI procedure in the new SKILL.md.

ClientSideTransport Error Normalization

Layer / File(s) Summary
toUIMessageStream onError handler
packages/xl-ai/src/streamTool/vercelAiSdk/clientside/ClientSideTransport.ts
toUIMessageStream is now called with an onError callback that returns error.message for Error instances and String(error) for all other throwables, replacing the previous default (no explicit error handling).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~4 minutes

Poem

🐇 Hippity-hop, I moved the rules,
From AGENTS to skills with proper tools.
A new SKILL.md now holds the way
To search for issues without delay!
And errors? Now strings — neat and clear,
A tidy little PR, my dear. ✨

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/extract-github-search-skill

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

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

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