Filter not work when leaving the conversation before it stopped #3367

Closed
opened 2025-11-11 15:30:17 -06:00 by GiteaMirror · 0 comments
Owner

Originally created by @xinhai-ai on GitHub (Jan 23, 2025).

Bug Report


Installation Method

docker

Environment

  • Open WebUI Version: [v0.5.6]

  • Operating System: [Debian GNU/Linux 12]

  • Browser (if applicable): [chrome 131.0.6778.265]

Confirmation:

  • I have read and followed all the instructions provided in the README.md.
  • I am on 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 provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below.

Expected Behavior:

Filter work well when leaving the conversation before it stopped

Actual Behavior:

Filter not work when leaving the conversation before it stopped

Description

Bug Summary:
Filter not work when leaving the conversation before it stopped

Reproduction Details

Steps to Reproduce:
I make a simple Filter to reproduce.

from pydantic import BaseModel, Field
from typing import Optional
class Filter:
    class Valves(BaseModel):
        priority: int = Field(
            default=0, description="Priority level for the filter operations."
        )
        pass
    class UserValves(BaseModel):
        pass
    def __init__(self):
        self.valves = self.Valves()
        pass
    def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict:
        print("Start !")
        return body
    def outlet(self, body: dict, __user__: Optional[dict] = None) -> dict:
        print("Filter worked!")
        return body

and a model named test1 with the Filter (base model is gemini-2.0-flash-exp)

i tell tell me 1000 words about you to the model

when i didn't leave the conversation,the Filter worked well

the docker logs are here

INFO:     IP:0 - "POST /api/v1/chats/27070a2c-b6fc-465d-8fc0-45986faecefa HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
INFO  [open_webui.routers.openai] get_all_models()
Start !
INFO:     IP:0 - "GET /c/27070a2c-b6fc-465d-8fc0-45986faecefa HTTP/1.1" 200 OK
INFO:     IP:0 - "POST /api/chat/completions HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
INFO:     IP:0 - "GET / HTTP/1.1" 200 OK
INFO  [open_webui.routers.openai] get_all_models()
Filter worked!
INFO:     IP:0 - "POST /api/chat/completed HTTP/1.1" 200 OK

but when I left the conversation before it stopped, something was wrong

INFO:     IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
INFO  [open_webui.routers.openai] get_all_models()
Start !
INFO:     IP:0 - "POST /api/chat/completions HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /api/v1/chats/ba981aee-e91b-4ba4-9510-0f55bc74d60f HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /api/v1/chats/ba981aee-e91b-4ba4-9510-0f55bc74d60f/tags HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /api/v1/users/user/settings HTTP/1.1" 200 OK
INFO:     IP:0 - "GET /ollama/api/version HTTP/1.1" 200 OK

In this steps, I switch to another conversation after press enter

the words Filter worked! didn't appear, even if switch back

Logs and Screenshots

Docker Container Logs:

Additional Information

[Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]

Originally created by @xinhai-ai on GitHub (Jan 23, 2025). # Bug Report --- ## Installation Method docker ## Environment - **Open WebUI Version:** [v0.5.6] - **Operating System:** [Debian GNU/Linux 12] - **Browser (if applicable):** [chrome 131.0.6778.265] **Confirmation:** - [x] I have read and followed all the instructions provided in the README.md. - [x] I am on the latest version of both Open WebUI and Ollama. - [ ] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have provided the exact steps to reproduce the bug in the "Steps to Reproduce" section below. ## Expected Behavior: Filter work well when leaving the conversation before it stopped ## Actual Behavior: Filter not work when leaving the conversation before it stopped ## Description **Bug Summary:** Filter not work when leaving the conversation before it stopped ## Reproduction Details **Steps to Reproduce:** I make a simple Filter to reproduce. ``` from pydantic import BaseModel, Field from typing import Optional class Filter: class Valves(BaseModel): priority: int = Field( default=0, description="Priority level for the filter operations." ) pass class UserValves(BaseModel): pass def __init__(self): self.valves = self.Valves() pass def inlet(self, body: dict, __user__: Optional[dict] = None) -> dict: print("Start !") return body def outlet(self, body: dict, __user__: Optional[dict] = None) -> dict: print("Filter worked!") return body ``` and a model named test1 with the Filter (base model is gemini-2.0-flash-exp) i tell `tell me 1000 words about you` to the model when i didn't leave the conversation,the Filter worked well the docker logs are here ``` INFO: IP:0 - "POST /api/v1/chats/27070a2c-b6fc-465d-8fc0-45986faecefa HTTP/1.1" 200 OK INFO: IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK INFO [open_webui.routers.openai] get_all_models() Start ! INFO: IP:0 - "GET /c/27070a2c-b6fc-465d-8fc0-45986faecefa HTTP/1.1" 200 OK INFO: IP:0 - "POST /api/chat/completions HTTP/1.1" 200 OK INFO: IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK INFO: IP:0 - "GET / HTTP/1.1" 200 OK INFO [open_webui.routers.openai] get_all_models() Filter worked! INFO: IP:0 - "POST /api/chat/completed HTTP/1.1" 200 OK ``` but when I left the conversation before it stopped, something was wrong ``` INFO: IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK INFO [open_webui.routers.openai] get_all_models() Start ! INFO: IP:0 - "POST /api/chat/completions HTTP/1.1" 200 OK INFO: IP:0 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK INFO: IP:0 - "GET /api/v1/chats/ba981aee-e91b-4ba4-9510-0f55bc74d60f HTTP/1.1" 200 OK INFO: IP:0 - "GET /api/v1/chats/ba981aee-e91b-4ba4-9510-0f55bc74d60f/tags HTTP/1.1" 200 OK INFO: IP:0 - "GET /api/v1/users/user/settings HTTP/1.1" 200 OK INFO: IP:0 - "GET /ollama/api/version HTTP/1.1" 200 OK ``` In this steps, I switch to another conversation after press enter the words `Filter worked!` didn't appear, even if switch back ## Logs and Screenshots **Docker Container Logs:** ## Additional Information [Include any additional details that may help in understanding and reproducing the issue. This could include specific configurations, error messages, or anything else relevant to the bug.]
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#3367