Skip to content

fix(api): prevent SSE streaming content duplication in controller#48

Merged
jjroelofs merged 1 commit into
1.xfrom
fix/1.x/fix-sse-content-duplication
Jun 9, 2026
Merged

fix(api): prevent SSE streaming content duplication in controller#48
jjroelofs merged 1 commit into
1.xfrom
fix/1.x/fix-sse-content-duplication

Conversation

@jjroelofs

Copy link
Copy Markdown
Contributor

Summary

  • Fixes SSE streaming content duplication where the metadata pass-through logic conflicted with the AI module's URL-safety buffer
  • Controller now uses getText() for content and getRaw() for response-level metadata (id, model, usage, etc.)
  • Skips empty-text messages that are still being buffered

Test plan

  • Verify streaming AI responses render correctly without duplicated HTML tags
  • Verify usage and model metadata still appears in SSE chunks

Fixes #47

The metadata pass-through logic sent raw content from the
provider's metadata, which was then sent again when the AI
module's internal buffer flushed. Use getText() for content
and extract response-level fields from getRaw() instead.
@jjroelofs jjroelofs merged commit bd4df3a into 1.x Jun 9, 2026
5 checks passed
@jjroelofs jjroelofs deleted the fix/1.x/fix-sse-content-duplication branch June 9, 2026 11:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(api): SSE streaming content duplication in AiChatController

1 participant