Fix: Chat streaming, error handling, and emoji rendering#2
Merged
Conversation
Scooletz
approved these changes
Jul 8, 2026
poissoncorp
approved these changes
Jul 14, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ChatInterface.tsx — Fixed [object Object] in chat responses
The RavenDB AI Agent streams responses as a series of Reply { answer, followups } objects rather than raw strings. The previous code used botText += JSON.parse(chunk), which resulted in "[object Object]" due to JavaScript's standard toString() behavior on objects. Since each incoming chunk already contains the fully accumulated response text up to that moment, the fix replaces botText directly with parsed.answer instead of appending the entire object.
api.ts — Fixed stuck loading state on backend errors
When an exception occurs, the backend sends an SSE event: error (containing a ChatResponse with the error message) and then closes the stream. The previous code only handled event: final, meaning the error event fell through to onChunk. As a result, the Promise never resolved, leaving the application permanently stuck in a loading state with the input disabled.
The fix treats event: error exactly like event: final: it aborts the connection (ctrl.abort()) and resolves the Promise with the response. This ensures backend errors are properly displayed as chat messages, allowing the user to continue typing.
The font stack lacked dedicated emoji fonts, preventing the browser from properly rendering emojis in the AI's responses and causing them to display as black diamonds (◆). Added 'Segoe UI Emoji', 'Segoe UI Symbol', 'Apple Color Emoji', and 'Noto Color Emoji' directly after 'Segoe UI' to ensure a proper fallback across all major platforms (Windows, macOS, and Linux).