mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-08 04:16:03 -05:00
[GH-ISSUE #23740] feat: recent dev changes for outlet_filter_handler do not handle the API caller use-case #35586
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?
Originally created by @pfn on GitHub (Apr 15, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23740
Check Existing Issues
Verify Feature Scope
Problem Description
API calls (and temp chats) through openwebui are not invoking pipeline/filter
outlet()This check
if not chat_id or chat_id.startswith('local:') or not message_id:inoutlet_filter_handlerautomatically filters out API callers and temp chats. API callers do not have a chat_id nor message_idThe code below relies on a persistent chat that is not available for API callers and temp chats.
Additionally, to even get to this point, a chat_id and message_id need to be manufactured and assigned to
extra_paramsbefore callinginlet()inprocess_chat_payload(edit: it seems manufacturing a message_id and/or chat_id like this causes streaming API calls to fail and return null)
Desired Solution you'd like
For the case of API callers and temp chats, the outlet should always be called with the most recent message, not the entire chat log (there isn't one).
This means that the last message (for API callers and temp chats) should always be saved and passed along in ctx so that they can be passed to
outlet()-- stream-based calls will need to have their contents captured during streaming in order for this to work. Similarly, non-streaming calls will need to have their contents captured and passed along as well.Alternatives Considered
No known alternatives at the moment. Besides using something like litellm as another proxy layer.
Additional Context
Currently running on dev with commithash
5dae600ce7@Classic298 commented on GitHub (Apr 15, 2026):
Thanks for raising this
As discussed on discord, a high priority filter that runs as first filter that creates a synthetic chat_id if none exists for a request is the solution here - then the outlet() WILL RUN.
I have updated the docs to accomondate for that and provide a minimalistic example of how to do it
0.9.0 will be the first version that allows outlet() 's to run regardless of where the request comes from - as long as a chat_id is present - which isn't the case for direct API requests but that CAN easily be made the case with a very very small high priority filter that synthesizes a chat id :)
@pfn commented on GitHub (Apr 16, 2026):
@Classic298 I've been testing this evening and the support is not yet complete, please see my linked diff and filter function that are needed to support what you describe https://gist.github.com/pfn/cdf3631365e6bee59912016b7a953175