[PR #1773] [MERGED] Fixed OpenRouter heart beats breaking streaming #20772

Closed
opened 2026-04-20 03:10:21 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/1773
Author: @Rmaan
Created: 4/26/2024
Status: Merged
Merged: 4/26/2024
Merged by: @tjbck

Base: devHead: fix-openrouter-streaming


📝 Commits (2)

  • 7449634 Fix OpenRouter hearbeats breaking streaming
  • 4ad7ef8 add else

📊 Changes

1 file changed (+4 additions, -0 deletions)

View changed files

📝 src/lib/apis/streaming/index.ts (+4 -0)

📄 Description

Pull Request Checklist

  • Description: Briefly describe the changes in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation?
    No need
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
    No

Description

Open WebUI doesn't work with Open Router as advertised in the Readme. When you try to do a chat completion, you can see errors on the front-end like:
image
Underlying reason is OpenRouter, when used in streaming mode sends heart beats in the stream like : OPENROUTER PROCESSING but front-end is not ignoring them.

According to MDN all events that starts with a colon should be ignored. I simply did that.


Changelog Entry

Fixed

  • Fixed OpenRouter heart beats breaking streaming

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/open-webui/open-webui/pull/1773 **Author:** [@Rmaan](https://github.com/Rmaan) **Created:** 4/26/2024 **Status:** ✅ Merged **Merged:** 4/26/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix-openrouter-streaming` --- ### 📝 Commits (2) - [`7449634`](https://github.com/open-webui/open-webui/commit/7449634290cc9b508067c0d1d843797328a0c4bc) Fix OpenRouter hearbeats breaking streaming - [`4ad7ef8`](https://github.com/open-webui/open-webui/commit/4ad7ef84a4357e57232dd9a7db5a9e5be0335c74) add else ### 📊 Changes **1 file changed** (+4 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/apis/streaming/index.ts` (+4 -0) </details> ### 📄 Description ## Pull Request Checklist - [X] **Description:** Briefly describe the changes in this pull request. - [X] **Changelog:** Ensure a changelog entry following the format of [Keep a Changelog](https://keepachangelog.com/) is added at the bottom of the PR description. - [X] **Documentation:** Have you updated relevant documentation? No need - [X] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? No --- ## Description Open WebUI doesn't work with Open Router as advertised in the Readme. When you try to do a chat completion, you can see errors on the front-end like: ![image](https://github.com/open-webui/open-webui/assets/1183449/8e49880e-b50b-42d5-9bdb-5b6f85f9032e) Underlying reason is OpenRouter, when used in streaming mode sends heart beats in the stream like `: OPENROUTER PROCESSING` but front-end is not ignoring them. According to [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events#event_stream_format) all events that starts with a colon should be ignored. I simply did that. --- ### Changelog Entry ### Fixed - Fixed OpenRouter heart beats breaking streaming --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-20 03:10:21 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#20772