Skip to content

Fix SSE streaming responses contain duplicate 'data:' prefix breaking OpenAI compatibility #53

@Michael-A-Kuykendall

Description

@Michael-A-Kuykendall

Bug Description

Streaming responses contain data: data: which breaks OpenAI compatibility as described in #26.

Technical Details

The issue is in src/openai_compat.rs where SSE responses are being formatted with an extra data: prefix and newlines:

  • Initial chunk: data: {json}\n\n should be just {json}
  • Token chunks: data: {json}\n\n should be just {json}
  • Final chunk: data: [DONE]\n\n should be just [DONE]

Expected Behavior

SSE streaming should send clean JSON objects without the duplicate data: prefix to maintain OpenAI API compatibility.

Reported by

@qlyoung in PR #49 (declined due to governance requirements but bug report is valid)

Priority

High - affects OpenAI API compatibility

Metadata

Metadata

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions