[GH-ISSUE #12656] issue: task model calls don't obey filter configuration #32202

Closed
opened 2026-04-25 06:05:20 -05:00 by GiteaMirror · 4 comments
Owner

Originally created by @lattwood on GitHub (Apr 9, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12656

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.2

Ollama Version (if applicable)

No response

Operating System

N/A

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

If I have a filter function added to a model, or a filter function enabled as global, I would expect that it is invoked for all uses of the model-

  • chatting
  • title generation
  • autocomplete

Actual Behavior

The filter function doesn't execute for task model invocations.

Steps to Reproduce

  • Add a filter function
  • Make it global
  • Watch as it does get invoked for completions but not title generation etc

Logs & Screenshots

N/A

Additional Information

I think open_webui.utils.filter.process_filter_functions gets used for processing inlet and outlet filter functions, but in open_webui/routers/tasks.py the method is imported and never called.

e31f680788

This commit added the import of the process_filter_functions method, but the code modifications were all to add calls to process_pipeline_inlet_filter. This is speculation, but I think the intent of that commit was to add calls to process_filter_functions(filter_type="inlet", ...)?

Originally created by @lattwood on GitHub (Apr 9, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12656 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.2 ### Ollama Version (if applicable) _No response_ ### Operating System N/A ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior If I have a filter function added to a model, or a filter function enabled as global, I would expect that it is invoked for all uses of the model- * chatting * title generation * autocomplete ### Actual Behavior The filter function doesn't execute for task model invocations. ### Steps to Reproduce * Add a filter function * Make it global * Watch as it does get invoked for completions but not title generation etc ### Logs & Screenshots N/A ### Additional Information I think `open_webui.utils.filter.process_filter_functions` gets used for processing inlet and outlet filter functions, but in `open_webui/routers/tasks.py` the method is imported and never called. https://github.com/open-webui/open-webui/commit/e31f680788910b04a1709271979c1b416f1b839a This commit added the import of the `process_filter_functions` method, but the code modifications were all to add calls to `process_pipeline_inlet_filter`. This is speculation, but I think the intent of that commit was to add calls to `process_filter_functions(filter_type="inlet", ...)`?
GiteaMirror added the bug label 2026-04-25 06:05:20 -05:00
Author
Owner

@lattwood commented on GitHub (Apr 10, 2025):

Also looks like this is the case with image generation

<!-- gh-comment-id:2795138474 --> @lattwood commented on GitHub (Apr 10, 2025): Also looks like this is the case with image generation
Author
Owner

@lattwood commented on GitHub (Apr 11, 2025):

And this appears to be the case for when using the new MCPO tools- not when sending the initial request, but when o3-mini decides to start invoking tools during the reasoning process.

This is a problem because of using this inlet Filter to add user details to the outbound requests for cost tracking, which I've included below.

from pydantic import BaseModel
from typing import Optional


class Filter:
    class Valves(BaseModel):
        pass

    def __init__(self):
        self.valves = self.Valves()

    async def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict:
        if __user__ is not None:
            body["user"] = __user__["email"]
        return body
<!-- gh-comment-id:2797883777 --> @lattwood commented on GitHub (Apr 11, 2025): And this appears to be the case for when using the new MCPO tools- not when sending the initial request, but when o3-mini decides to start invoking tools during the reasoning process. This is a problem because of using this inlet Filter to add user details to the outbound requests for cost tracking, which I've included below. ``` from pydantic import BaseModel from typing import Optional class Filter: class Valves(BaseModel): pass def __init__(self): self.valves = self.Valves() async def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict: if __user__ is not None: body["user"] = __user__["email"] return body ```
Author
Owner

@csantv commented on GitHub (Apr 13, 2025):

i'm experiencing the same issue, switching to pipelines from filter functions could help but that is overkill as it'd require a new container

<!-- gh-comment-id:2799966622 --> @csantv commented on GitHub (Apr 13, 2025): i'm experiencing the same issue, switching to pipelines from filter functions could help but that is overkill as it'd require a new container
Author
Owner

@tjbck commented on GitHub (Apr 14, 2025):

Intended behaviour, if we were to introduce this change, this will break a lot of existing filter workflows.

<!-- gh-comment-id:2800724711 --> @tjbck commented on GitHub (Apr 14, 2025): Intended behaviour, if we were to introduce this change, this will break a lot of existing filter workflows.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#32202