-
Notifications
You must be signed in to change notification settings - Fork 2.6k
fix: ensure Roo provider yields text content to prevent blank UI responses #8349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
…onses - Added logic to yield empty text chunk when only reasoning content is received - This prevents the UI from showing blank responses for models that only output thinking/reasoning - Fixes issue #8348 where Supernova and other free Roo Cloud models showed blank responses
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-review engaged: the robot graded its own homework and still found nits.
|
|
||
| // If we only received reasoning content and no text content, yield an empty text chunk | ||
| // This ensures the UI doesn't show a blank response | ||
| if (!hasYieldedContent) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2 — Ordering UX: when the stream contains only usage (no text) the current implementation yields the usage chunk first and the empty text chunk afterward. This can keep the UI blank until the very end. Consider emitting an empty text chunk right before usage when no text has been yielded yet.
| if (!hasYieldedContent) { | |
| if (chunk.usage) { | |
| if (!hasYieldedContent) { | |
| yield { | |
| type: "text", | |
| text: "", | |
| } | |
| hasYieldedContent = true | |
| } | |
| yield { | |
| type: "usage", | |
| inputTokens: chunk.usage.prompt_tokens || 0, | |
| outputTokens: chunk.usage.completion_tokens || 0, | |
| } | |
| } |
| metadata?.taskId ? { headers: { "X-Roo-Task-ID": metadata.taskId } } : undefined, | ||
| ) | ||
|
|
||
| let hasYieldedContent = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P3 — Minor clarity: add a comment clarifying that reasoning-only output should not count as content for avoiding blank UI responses.
| let hasYieldedContent = false | |
| // Tracks if any text content has been emitted; reasoning-only output doesn't count | |
| let hasYieldedContent = false |
Description
This PR addresses Issue #8348 where Supernova and other free Roo Cloud models were showing blank responses in the UI when they only returned reasoning/thinking content without actual text content.
Problem
When certain Roo Cloud models (like Supernova) only return reasoning content without text content, the UI would appear blank because no text chunks were being yielded to the stream.
Solution
Modified the Roo provider to track whether any text content has been yielded during streaming. If no text content was yielded by the end of the stream (only reasoning was received), an empty text chunk is yielded to ensure the UI has something to display.
Changes
hasYieldedContentflag insrc/api/providers/roo.tsto track if text content was yieldedTesting
Related Issues
Fixes #8348
Review Confidence
The implementation review showed 95% confidence with no security issues or convention violations.
Feedback and guidance are welcome!
Important
Fixes issue #8348 by ensuring Roo provider yields an empty text chunk if no text content is present, preventing blank UI responses.
roo.ts, addedhasYieldedContentflag to track if text content is yielded increateMessage().roo.spec.tsto cover scenarios where only reasoning content is received, actual text content is received, and completely empty streams.This description was created by
for 1b0e3d9. You can customize this summary. It will automatically update as commits are pushed.