[PR #23763] [CLOSED] fix: run outlet filters for API callers without chat_id / message_id #42989

Closed
opened 2026-04-25 14:43:50 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/open-webui/open-webui/pull/23763
Author: @Classic298
Created: 4/15/2026
Status: Closed

Base: devHead: claude/fix-outlet-filter-handler-C46ht


📝 Commits (2)

  • 7d894cd fix: run outlet filters for API callers without chat_id / message_id
  • 86bf3a6 refac: trim noisy comments in outlet_filter_handler

📊 Changes

1 file changed (+13 additions, -13 deletions)

View changed files

📝 backend/open_webui/utils/middleware.py (+13 -13)

📄 Description

Upstream 70a6a24 extended outlet_filter_handler to handle temp chats (chat_id prefixed with 'local:') by building the message list in-memory from form_data + ctx['assistant_message']. API callers of /api/chat/completions that omit chat_id and/or id in the request body still hit the early-return guard and never had their outlet filters run.

Route those callers into the same in-memory branch and synthesize local-only chat_id / message_id values scoped to the outlet payload (never written back to metadata, so streaming save, event routing and webhook URLs keep seeing the real None values). Closes #23740.

Contributor License Agreement

Note

Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in.


🔄 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/23763 **Author:** [@Classic298](https://github.com/Classic298) **Created:** 4/15/2026 **Status:** ❌ Closed **Base:** `dev` ← **Head:** `claude/fix-outlet-filter-handler-C46ht` --- ### 📝 Commits (2) - [`7d894cd`](https://github.com/open-webui/open-webui/commit/7d894cdea7a8f5a0fab276eca001fbd2988b6eeb) fix: run outlet filters for API callers without chat_id / message_id - [`86bf3a6`](https://github.com/open-webui/open-webui/commit/86bf3a655e7e94a277eb6f6705085171ac854464) refac: trim noisy comments in outlet_filter_handler ### 📊 Changes **1 file changed** (+13 additions, -13 deletions) <details> <summary>View changed files</summary> 📝 `backend/open_webui/utils/middleware.py` (+13 -13) </details> ### 📄 Description Upstream 70a6a24 extended outlet_filter_handler to handle temp chats (chat_id prefixed with 'local:') by building the message list in-memory from form_data + ctx['assistant_message']. API callers of /api/chat/completions that omit chat_id and/or id in the request body still hit the early-return guard and never had their outlet filters run. Route those callers into the same in-memory branch and synthesize local-only chat_id / message_id values scoped to the outlet payload (never written back to metadata, so streaming save, event routing and webhook URLs keep seeing the real None values). Closes #23740. ### Contributor License Agreement <!-- 🚨 DO NOT DELETE THE TEXT BELOW 🚨 Keep the "Contributor License Agreement" confirmation text intact. Deleting it will trigger the CLA-Bot to INVALIDATE your PR. Your PR will NOT be reviewed or merged until you check the box below confirming that you have read and agree to the terms of the CLA. --> - [X] By submitting this pull request, I confirm that I have read and fully agree to the [Contributor License Agreement (CLA)](https://github.com/open-webui/open-webui/blob/main/CONTRIBUTOR_LICENSE_AGREEMENT), and I am providing my contributions under its terms. > [!NOTE] > Deleting the CLA section will lead to immediate closure of your PR and it will not be merged in. --- <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-25 14:43:50 -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#42989