mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 21:09:41 -05:00
[PR #18654] fix: Function/Pipeline valves not triggered for async chat completition #24871
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/18654
Author: @YetheSamartaka
Created: 10/27/2025
Status: 🔄 Open
Base:
dev← Head:dev📝 Commits (3)
fe178e6fix: Function/Pipeline valves not triggered for async chat completitionde94a84Merge branch 'dev' into dev4fa3da7updated nesting after latest dev branch update📊 Changes
2 files changed (+375 additions, -260 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+375 -221)📝
src/lib/components/chat/Chat.svelte(+0 -39)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.
Before submitting, make sure you've checked the following:
devbranch. Not targeting thedevbranch may lead to immediate closure of the PR.Changelog Entry
Description
When multiple chats were opened simultaneously, their completions finished asynchronously in the background without triggering Filters or Pipelines events. This caused missed post-processing steps (source enrichment, analytics, or message updates) because the chatCompleted handler was only called client-side - and only for the currently active chat.
How I fixed it:
Moved the chatCompleted call from the frontend (Chat.svelte) to the backend middleware. This was inherent flaw in the whole design which this PR is fixing.
Now, chat_completed() is invoked automatically after every chat finishes, regardless of whether it completes in the background or while another chat is active.
Fixed
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.