Skip to content

Fix #6665: [Bug]#6705

Closed
danielalanbates wants to merge 1 commit intoChatGPTNextWeb:mainfrom
danielalanbates:fix/issue-6665
Closed

Fix #6665: [Bug]#6705
danielalanbates wants to merge 1 commit intoChatGPTNextWeb:mainfrom
danielalanbates:fix/issue-6665

Conversation

@danielalanbates
Copy link

Fixes #6665

Summary

This PR fixes: [Bug]

Changes

app/utils/chat.ts | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

Testing

Please review the changes carefully. The fix was verified against the existing test suite.


This PR was created with the assistance of Claude Sonnet 4.6 by Anthropic | effort: low. Happy to make any adjustments!

…ing requests

The @fortaine/fetch-event-source library only sets Accept: text/event-stream
when no Accept header is provided by the caller. However, getHeaders() sets
Accept: application/json, which takes precedence and can cause some servers
or proxies to return a non-SSE response. When the response content-type does
not match text/event-stream, the onopen error handler reads the entire raw
response body (including all data: {...} SSE lines) and displays it as the
chat message, resulting in garbled output on iOS Safari and other clients.

Fix by explicitly setting Accept: text/event-stream in the chatPayload
headers for both stream() and streamWithThink(), overriding the generic
application/json Accept header for SSE streaming connections.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@Kadxy Kadxy closed this Feb 21, 2026
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.

[Bug]

2 participants