mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[PR #23775] [CLOSED] fix: run outlet filters for API callers (streaming + non-streaming) #42996
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/23775
Author: @Classic298
Created: 4/16/2026
Status: ❌ Closed
Base:
dev← Head:claude/fix-outlet-filter-handler-C46ht📝 Commits (10+)
7d894cdfix: run outlet filters for API callers without chat_id / message_id86bf3a6refac: trim noisy comments in outlet_filter_handler7e11ba9feat: fire outlet filters for API callers end-to-end (#23740, #23770)85e4223fix: address automated review findings on outlet-for-API PRdf072d0fix: address second review pass on outlet-for-API PR84d8ceefix: address third review pass on outlet-for-API PR63fd7bffix: address fourth review pass on outlet-for-API PR68d86farefac: trim comments346fa14fix: address fifth review pass on outlet-for-API PR68da793fix: address sixth review pass on outlet-for-API PR📊 Changes
1 file changed (+362 additions, -89 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+362 -89)📄 Description
Closes #23740, addresses #23770.
Upstream
70a6a24madeoutlet_filter_handlerwork for temp chats (local:prefix) but left two gaps for API callers of/api/chat/completions:streaming_chat_response_handler's main path (guarded byif event_emitter:atmiddleware.py:3376) has no explicit return in its innerresponse_handler— it returnsNone, leaving the API caller with an empty body. UI callers don't notice because they receive content via WebSocket events.else:at 4878) and the non-streaming handler gate outlet onevent_emitter, so callers without a WebSocket session silently skip outlet entirely.Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.