mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:24:24 -05:00
[PR #22085] [CLOSED] perf: skip db writes for non-terminal status events #42101
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/22085
Author: @Algorithm5838
Created: 3/1/2026
Status: ❌ Closed
Base:
dev← Head:fix/skip-intermediate-status-db-writes📝 Commits (1)
2d32836perf: skip db writes for non-terminal status events📊 Changes
1 file changed (+7 additions, -5 deletions)
View changed files
📝
backend/open_webui/socket/main.py(+7 -5)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is to ensure large feature PRs are discussed with the community first, before starting work on it. If the community does not want this feature or it is not relevant for Open WebUI as a project, it can be identified in the discussion before working on the feature and submitting the PR.
Before submitting, make sure you've checked the following:
devbranch. PRs targetingmainwill be immediately closed.devto ensure no unrelated commits (e.g. frommain) are included. Push updates to the existing PR branch instead of closing and reopening.Changelog Entry
Description
Every status event during streaming ("Thinking...", "Searching web...", etc.) calls
add_message_status_to_chat_by_id_and_message_id, which does a full read-modify-write of the chat JSON blob. A typical tool-use response triggers 5-15 of these for states that are only shown live during streaming.The client already gets these via the socket emit before the DB call, so the live UI is unaffected. The only status that matters for the persisted
statusHistoryis the finaldone=Trueone, which the frontend uses to render the collapsed summary after streaming (e.g. "Searched 3 sites").This adds a
doneguard so only terminal statuses hit the DB. Intermediate ones stay socket-only.Added
Changed
socket/main.py: guard status DB write withevent_data.get("data", {}).get("done", False)Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Screenshots or Videos
Contributor License Agreement
By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.