Skip to content

Decode the LLM event stream as UTF-8 - #11

Merged
CodexManvik merged 1 commit into
mainfrom
fix-stream-utf8
Nov 8, 2026
Merged

CodexManvik merged 1 commit into
mainfrom
fix-stream-utf8

Conversation

@CodexManvik

Copy link
Copy Markdown
Owner

Streamed answers from /query/stream showed mojibake, for example 0.8 µmol/kg instead of 0.8 µmol/kg. Groq's event stream has no charset in its Content-Type, so requests decoded it as ISO-8859-1. The fix reads the stream as bytes and decodes each line as UTF-8; a unit test covers it.

This only affected streaming. /query uses chat(), which decodes JSON correctly. But both endpoints share the answer cache, so a garbled streamed answer could also be served by /query. The redeploy clears that in-memory cache.

Found while building the Phase 3 web app, the first client of the streaming endpoint.

🤖 Generated with Claude Code

Groq's event stream carries no charset, so requests decoded it as ISO-8859-1
and streamed answers showed mojibake (for example around µmol/kg and narrow
spaces). Read bytes and decode each line as UTF-8.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings November 8, 2026 22:14
@coderabbitai

coderabbitai Bot commented Nov 8, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8c3de03b-df0e-4b18-a012-f57deb6f6859
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@CodexManvik
CodexManvik merged commit a3c8bab into main Nov 8, 2026
5 checks passed
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.

2 participants