[PR #1780] [MERGED] fix: harden openai streaming parsing #43822

Closed
opened 2026-04-29 17:49:56 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

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

Base: devHead: fix/harden-streaming


📝 Commits (2)

  • 510afab fix: catch any errors parsing openai sse events
  • 615e9e3 fix: do not error out if OpenAI response has no delta

📊 Changes

1 file changed (+7 additions, -3 deletions)

View changed files

📝 src/lib/apis/streaming/index.ts (+7 -3)

📄 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?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?

Description

Fixes https://github.com/open-webui/open-webui/issues/1759. Uses optional chaining to prevent errors when a delta is not present, and also catches any errors parsing the JSON.

This is complementary to https://github.com/open-webui/open-webui/pull/1773, since without #1773 this fix would still log errors.


Changelog Entry

Fixed

  • Compatibility with OpenAI endpoints that return unexpected values

🔄 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/1780 **Author:** [@cheahjs](https://github.com/cheahjs) **Created:** 4/26/2024 **Status:** ✅ Merged **Merged:** 4/26/2024 **Merged by:** [@tjbck](https://github.com/tjbck) **Base:** `dev` ← **Head:** `fix/harden-streaming` --- ### 📝 Commits (2) - [`510afab`](https://github.com/open-webui/open-webui/commit/510afab37c0085ef29e6dfa21d63b17c2a060b2e) fix: catch any errors parsing openai sse events - [`615e9e3`](https://github.com/open-webui/open-webui/commit/615e9e348f2a696a170627de11b3c5a3f9c0a913) fix: do not error out if OpenAI response has no delta ### 📊 Changes **1 file changed** (+7 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `src/lib/apis/streaming/index.ts` (+7 -3) </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. - [ ] **Documentation:** Have you updated relevant documentation? - [ ] **Dependencies:** Are there any new dependencies? Have you updated the dependency versions in the documentation? --- ## Description Fixes https://github.com/open-webui/open-webui/issues/1759. Uses optional chaining to prevent errors when a delta is not present, and also catches any errors parsing the JSON. This is complementary to https://github.com/open-webui/open-webui/pull/1773, since without #1773 this fix would still log errors. --- ### Changelog Entry ### Fixed - Compatibility with OpenAI endpoints that return unexpected values --- <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-29 17:49:56 -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#43822