Originally created by @rndmcnlly on GitHub (Aug 21, 2024).
Bug Report
Installation Method
Docker
Environment
Open WebUI Version: v0.3.13
Ollama (if applicable): n/a
Operating System: Ubuntu 24.04 LTS
Browser (if applicable): Crome, Version 127.0.6533.120 (Official Build) (arm64)
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:
When I dispatch the event {"type": "action", "data": {"action": "continue"}} in a filter outlet, I want it to have the same effect as if the user had pressed the Continue Response button in the UI.
Actual Behavior:
See screenshot below. The continued result does not display in the UI, and the buttons below the rely disappear. Further, the UI does not respond to additional user messages. The continuation seems to happen on the backend, but the page does not update. Refreshing the page makes the conversation responsive again, but the continued text is still not visible in the conversation history.
Description
Bug Summary:
Dispatching a continue action from a filter outlet leads to an unresponsive UI state.
Reproduction Details
Steps to Reproduce:
Install this filter, enabled globally:
Then, start a new conversation with a message like: Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).
When the filter is enabled, the conversation becomes unresponsive.
When the filter is disabled, the conversation remains responsive, and the result of manually pressing Continue Response looks like MEOWI've followed your instructions correctly by responding with "MEOW" as requested. How can I assist you further? as expected.
Logs and Screenshots
Browser Console Logs:
No relevant differences appear between the enabled and disabled scenarios in the browser console. In particular, I see a similar sequence of "chat.completion.chunk" message scroll by showing that the continuation is indeed streaming back form the backend in both scenarios.
Docker Container Logs:
With filter ENABLED
Note that the second outlet strangely message does not show any new data (despite the fact that I saw the new text scroll by in chunks in the browser log).
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:59680 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '0d4771dd-df97-42fe-a809-e22496a5e4d1', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'role': 'assistant', 'content': 'MEOW', 'timestamp': 1724266477}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2'}
open-webui | AUTO_CONTINUE firing!
open-webui | INFO: 172.18.0.1:59694 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'role': 'assistant', 'content': 'MEOW'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:59706 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59712 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59700 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59728 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59736 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '0d4771dd-df97-42fe-a809-e22496a5e4d1', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'role': 'assistant', 'content': 'MEOW', 'timestamp': 1724266477}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2'}
open-webui | AUTO_CONTINUE firing!
open-webui | INFO: 172.18.0.1:59746 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59740 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59752 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59748 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59760 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59762 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59768 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59778 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59792 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | INFO: 172.18.0.1:59802 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59806 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59820 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
With filter DISABLED (and manually pressing Continue Response)
The logs show mostly the same sequence of INFO lines above. Of course, there are no AUTO_CONTINUE lines because the filter was disabled.
With filter EDITED (and manually pressing Continue Response)
If I edit the code of the filter to comment out the if block of outlet, I can now see that the outlet does get to see the expected completion. This makes me thing the root cause of the problem is in the front end rather than back end.
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:41720 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '5368bda6-065a-4013-9d78-4dae865b6878', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'role': 'assistant', 'content': 'MEOW', 'timestamp': 1724266819}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '2ed530ad-241e-4acd-bb79-70dfd2023812'}
open-webui | INFO: 172.18.0.1:41724 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41738 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41742 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41746 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41756 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | INFO: 172.18.0.1:41768 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41770 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41772 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41782 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'role': 'assistant', 'content': 'MEOW'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:41792 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '5368bda6-065a-4013-9d78-4dae865b6878', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'role': 'assistant', 'content': 'MEOWI\'ve followed your instruction correctly by saying "MEOW" on a line by itself. If you\'d like to continue the conversation or have any questions, feel free to ask!', 'timestamp': 1724266819}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '2ed530ad-241e-4acd-bb79-70dfd2023812'}
open-webui | INFO: 172.18.0.1:41806 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41818 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41832 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41846 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41860 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | INFO: 172.18.0.1:41862 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41878 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41888 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
Screenshots/Screen Recordings (if applicable):
Additional Information
It might seem silly to auto-continue if the assistant says "MEOW", but this is just an attempt to simplify a buggy scenario that resulted from a much larger and more interesting application.
I suspect the issue has to do with the order in which various UI components update because things look okay on the back end. The fix might be as simple as wrapping the existing continueButton.click(); (in Chat.svelte) to use use requestIdleCallback or something.
Originally created by @rndmcnlly on GitHub (Aug 21, 2024).
# Bug Report
## Installation Method
Docker
## Environment
- **Open WebUI Version:** v0.3.13
- **Ollama (if applicable):** n/a
- **Operating System:** Ubuntu 24.04 LTS
- **Browser (if applicable):** Crome, Version 127.0.6533.120 (Official Build) (arm64)
**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.
- [x] 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:
When I dispatch the event `{"type": "action", "data": {"action": "continue"}}` in a filter outlet, I want it to have the same effect as if the user had pressed the Continue Response button in the UI.
## Actual Behavior:
See screenshot below. The continued result does not display in the UI, and the buttons below the rely disappear. Further, the UI does not respond to additional user messages. The continuation seems to happen on the backend, but the page does not update. Refreshing the page makes the conversation responsive again, but the continued text is still not visible in the conversation history.
## Description
**Bug Summary:**
Dispatching a continue action from a filter outlet leads to an unresponsive UI state.
## Reproduction Details
**Steps to Reproduce:**
Install this filter, enabled globally:
```python
class Filter:
def inlet(self, body: dict, __user__=None) -> dict:
print("AUTO_CONTINUE inlet: ", body)
return body
async def outlet(self, body: dict, __user__=None, __event_emitter__=None) -> dict:
print("AUTO_CONTINUE outlet: ", body)
if body["messages"][-1]["content"] == "MEOW":
print("AUTO_CONTINUE firing!")
await __event_emitter__({"type": "action", "data": {"action": "continue"}})
return body
```
Then, start a new conversation with a message like: `Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).`
When the filter is enabled, the conversation becomes unresponsive.
When the filter is disabled, the conversation remains responsive, and the result of manually pressing Continue Response looks like `MEOWI've followed your instructions correctly by responding with "MEOW" as requested. How can I assist you further?` as expected.
## Logs and Screenshots
**Browser Console Logs:**
No relevant differences appear between the enabled and disabled scenarios in the browser console. In particular, I see a similar sequence of "chat.completion.chunk" message scroll by showing that the continuation is indeed streaming back form the backend in both scenarios.
**Docker Container Logs:**
### With filter ENABLED
Note that the second `outlet` strangely message does not show any new data (despite the fact that I saw the new text scroll by in chunks in the browser log).
```
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:59680 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '0d4771dd-df97-42fe-a809-e22496a5e4d1', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'role': 'assistant', 'content': 'MEOW', 'timestamp': 1724266477}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2'}
open-webui | AUTO_CONTINUE firing!
open-webui | INFO: 172.18.0.1:59694 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'role': 'assistant', 'content': 'MEOW'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:59706 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59712 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59700 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59728 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59736 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '0d4771dd-df97-42fe-a809-e22496a5e4d1', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2', 'role': 'assistant', 'content': 'MEOW', 'timestamp': 1724266477}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '1e6f7d78-0e30-41dd-8b8b-6412f9ff49a2'}
open-webui | AUTO_CONTINUE firing!
open-webui | INFO: 172.18.0.1:59746 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59740 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59752 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59748 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59760 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59762 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59768 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59778 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59792 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | INFO: 172.18.0.1:59802 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59806 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:59820 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
```
### With filter DISABLED (and manually pressing Continue Response)
The logs show mostly the same sequence of `INFO` lines above. Of course, there are no `AUTO_CONTINUE` lines because the filter was disabled.
### With filter EDITED (and manually pressing Continue Response)
If I edit the code of the filter to comment out the `if` block of `outlet`, I can now see that the outlet *does* get to see the expected completion. This makes me thing the root cause of the problem is in the front end rather than back end.
```
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:41720 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '5368bda6-065a-4013-9d78-4dae865b6878', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'role': 'assistant', 'content': 'MEOW', 'timestamp': 1724266819}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '2ed530ad-241e-4acd-bb79-70dfd2023812'}
open-webui | INFO: 172.18.0.1:41724 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41738 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41742 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41746 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41756 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | INFO: 172.18.0.1:41768 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41770 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41772 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41782 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE inlet: {'stream': True, 'model': 'brace', 'messages': [{'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'role': 'assistant', 'content': 'MEOW'}], 'metadata': {'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'message_id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'valves': None, 'tool_ids': None, 'files': None}}
open-webui | INFO: 172.18.0.1:41792 - "POST /api/chat/completions HTTP/1.1" 200 OK
open-webui | AUTO_CONTINUE outlet: {'model': 'brace', 'messages': [{'id': '5368bda6-065a-4013-9d78-4dae865b6878', 'role': 'user', 'content': 'Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).'}, {'id': '2ed530ad-241e-4acd-bb79-70dfd2023812', 'role': 'assistant', 'content': 'MEOWI\'ve followed your instruction correctly by saying "MEOW" on a line by itself. If you\'d like to continue the conversation or have any questions, feel free to ask!', 'timestamp': 1724266819}], 'chat_id': 'e9522036-f877-4011-a396-cf2b6e952a34', 'session_id': '1EVh8G2HAJXf-xc1AABz', 'id': '2ed530ad-241e-4acd-bb79-70dfd2023812'}
open-webui | INFO: 172.18.0.1:41806 - "POST /api/chat/completed HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41818 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41832 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41846 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41860 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
open-webui | generate_title
open-webui | brace
open-webui | INFO: 172.18.0.1:41862 - "POST /api/task/title/completions HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41878 - "POST /api/v1/chats/e9522036-f877-4011-a396-cf2b6e952a34 HTTP/1.1" 200 OK
open-webui | INFO: 172.18.0.1:41888 - "GET /api/v1/chats/?page=1 HTTP/1.1" 200 OK
```
**Screenshots/Screen Recordings (if applicable):**
<img width="554" alt="auto-continue hung" src="https://github.com/user-attachments/assets/9bbdbaa1-4d37-47be-a442-413b65d46125">
## Additional Information
It might seem silly to auto-continue if the assistant says "MEOW", but this is just an attempt to simplify a buggy scenario that resulted from a much larger and more interesting application.
I suspect the issue has to do with the order in which various UI components update because things look okay on the back end. The fix might be as simple as wrapping the existing `continueButton.click();` (in `Chat.svelte`) to use use `requestIdleCallback` or something.
Taking a look. However, bug aside, you probably shouldn't use the action event to continue the response and stream the response using __event_emitter__ with message event from the outlet hook function instead.
@tjbck commented on GitHub (Aug 23, 2024):
Taking a look. However, bug aside, you probably shouldn't use the action event to continue the response and stream the response using `__event_emitter__` with message event from the outlet hook function instead.
@tjbck commented on GitHub (Aug 23, 2024):
Seems to have been a filter issue, if you're editing a content you shouldn't return the body content which will override the messages.
```py
class Filter:
def inlet(self, body: dict, __user__=None) -> dict:
print("AUTO_CONTINUE inlet: ", body)
return body
async def outlet(self, body: dict, __user__=None, __event_emitter__=None):
print("AUTO_CONTINUE outlet: ", body)
if body["messages"][-1]["content"] == "MEOW":
print("AUTO_CONTINUE firing!")
await __event_emitter__({"type": "action", "data": {"action": "continue"}})
```
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Originally created by @rndmcnlly on GitHub (Aug 21, 2024).
Bug Report
Installation Method
Docker
Environment
Open WebUI Version: v0.3.13
Ollama (if applicable): n/a
Operating System: Ubuntu 24.04 LTS
Browser (if applicable): Crome, Version 127.0.6533.120 (Official Build) (arm64)
Confirmation:
Expected Behavior:
When I dispatch the event
{"type": "action", "data": {"action": "continue"}}in a filter outlet, I want it to have the same effect as if the user had pressed the Continue Response button in the UI.Actual Behavior:
See screenshot below. The continued result does not display in the UI, and the buttons below the rely disappear. Further, the UI does not respond to additional user messages. The continuation seems to happen on the backend, but the page does not update. Refreshing the page makes the conversation responsive again, but the continued text is still not visible in the conversation history.
Description
Bug Summary:
Dispatching a continue action from a filter outlet leads to an unresponsive UI state.
Reproduction Details
Steps to Reproduce:
Install this filter, enabled globally:
Then, start a new conversation with a message like:
Say just "MEOW" on a line by itself. Later, when the conversation continues, comment on the history of the conversation so far (i.e. whether you were able to follow instructions correctly).When the filter is enabled, the conversation becomes unresponsive.
When the filter is disabled, the conversation remains responsive, and the result of manually pressing Continue Response looks like
MEOWI've followed your instructions correctly by responding with "MEOW" as requested. How can I assist you further?as expected.Logs and Screenshots
Browser Console Logs:
No relevant differences appear between the enabled and disabled scenarios in the browser console. In particular, I see a similar sequence of "chat.completion.chunk" message scroll by showing that the continuation is indeed streaming back form the backend in both scenarios.
Docker Container Logs:
With filter ENABLED
Note that the second
outletstrangely message does not show any new data (despite the fact that I saw the new text scroll by in chunks in the browser log).With filter DISABLED (and manually pressing Continue Response)
The logs show mostly the same sequence of
INFOlines above. Of course, there are noAUTO_CONTINUElines because the filter was disabled.With filter EDITED (and manually pressing Continue Response)
If I edit the code of the filter to comment out the
ifblock ofoutlet, I can now see that the outlet does get to see the expected completion. This makes me thing the root cause of the problem is in the front end rather than back end.Screenshots/Screen Recordings (if applicable):
Additional Information
It might seem silly to auto-continue if the assistant says "MEOW", but this is just an attempt to simplify a buggy scenario that resulted from a much larger and more interesting application.
I suspect the issue has to do with the order in which various UI components update because things look okay on the back end. The fix might be as simple as wrapping the existing
continueButton.click();(inChat.svelte) to use userequestIdleCallbackor something.@tjbck commented on GitHub (Aug 23, 2024):
Taking a look. However, bug aside, you probably shouldn't use the action event to continue the response and stream the response using
__event_emitter__with message event from the outlet hook function instead.@tjbck commented on GitHub (Aug 23, 2024):
Seems to have been a filter issue, if you're editing a content you shouldn't return the body content which will override the messages.