[GH-ISSUE #23019] issue: Prefilled input value resets when sending "input" event call #35398

Closed
opened 2026-04-25 09:36:35 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @souhailsadat on GitHub (Mar 25, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23019

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!).
  • I am using the latest version of Open WebUI.

Installation Method

Other

Open WebUI Version

v0.8.10

Ollama Version (if applicable)

No response

Operating System

Ubuntu 24.04 (Git Clone), Windows 11 (Docker)

Browser (if applicable)

Chrome, Firefox

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 provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When sending an event call of type input with a prefilled value, the prefilled value should be correctly sent to the user.

Actual Behavior

In most cases (but not always), the prefilled value is reset and sent empty to the user.

Steps to Reproduce

  1. Open Open WebUI in any browser, regardless of its installation method.
  2. Log in as an admin user.
  3. Click your username icon in the bottom-left corner.
  4. Go to the "Admin Panel".
  5. Select the "Functions" tab.
  6. Create a filter function that sends an input event call with a prefilled value in its inlet (see Additional Information for the code).
  7. Save the function.
  8. Enable the function and make it global.
  9. Send any prompt to trigger the input dialog.
  10. Observe that the input dialog value is correctly set the first time.
  11. Repeat sending additional prompts.
  12. Notice that the input dialog value is empty on subsequent prompts.

Logs & Screenshots

Filter function implementation (sending input event with prefilled value):

Image
from pydantic import BaseModel


class Filter:

    async def inlet(self, body: dict, __event_call__) -> dict:
        input = await __event_call__(
            {
                "type": "input",
                "data": {
                    "title": "What's your name?",
                    "message": "Please enter your name:",
                    "value": "Prefilled value",
                },
            }
        )
        return body

First trigger: input dialog with correctly prefilled value:

Image

Subsequent trigger: input dialog with empty value (unexpected behavior):

Image

Additional Information

Problematic Code

The issue appears to be caused by the changes introduced in commit fb26be7.
The goal of this commit was to reset the confirm dialog input when showing it, in order to avoid accidentally sending a previous user value. However, this behavior has an unintended side effect: it resets the value every time, even when the input is intentionally prefilled during an input event call.

	$: if (show) {
		init();
	}

	const init = () => {
		inputValue = '';
	};

Proposed Solution

Introduce a boolean variable in src/lib/components/chat/Chat.svelte to indicate whether the value is prefilled, and bind it to ConfirmDialog.svelte.

	prefilled = !!data?.value;

Then, in src/lib/components/common/ConfirmDialog.svelte, reset the input value only if the boolean is false:

	$: if (show && !prefilled) {
	    init();
	}

I can submit a pull request implementing this fix if needed.

Originally created by @souhailsadat on GitHub (Mar 25, 2026). Original GitHub issue: https://github.com/open-webui/open-webui/issues/23019 ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I have also searched in the CLOSED issues AND CLOSED discussions and found no related items (your issue might already be addressed on the development branch!). - [x] I am using the latest version of Open WebUI. ### Installation Method Other ### Open WebUI Version v0.8.10 ### Ollama Version (if applicable) _No response_ ### Operating System Ubuntu 24.04 (Git Clone), Windows 11 (Docker) ### Browser (if applicable) Chrome, Firefox ### 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 **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When sending an event call of type `input` with a prefilled `value`, the prefilled value should be correctly sent to the user. ### Actual Behavior In most cases (but not always), the prefilled `value` is reset and sent empty to the user. ### Steps to Reproduce 1. Open Open WebUI in any browser, regardless of its installation method. 2. Log in as an admin user. 3. Click your username icon in the bottom-left corner. 4. Go to the "Admin Panel". 5. Select the "Functions" tab. 6. Create a filter function that sends an input event call with a prefilled value in its inlet (see Additional Information for the code). 7. Save the function. 8. Enable the function and make it global. 9. Send any prompt to trigger the input dialog. 10. Observe that the input dialog value is correctly set the first time. 11. Repeat sending additional prompts. 12. Notice that the input dialog value is empty on subsequent prompts. ### Logs & Screenshots Filter function implementation (sending input event with prefilled value): <img width="1055" height="683" alt="Image" src="https://github.com/user-attachments/assets/24b868b7-5ae2-4e2d-82c9-a3f7585d8d69" /> ``` from pydantic import BaseModel class Filter: async def inlet(self, body: dict, __event_call__) -> dict: input = await __event_call__( { "type": "input", "data": { "title": "What's your name?", "message": "Please enter your name:", "value": "Prefilled value", }, } ) return body ``` First trigger: input dialog with correctly prefilled value: <img width="1352" height="658" alt="Image" src="https://github.com/user-attachments/assets/d0cfc6b6-f32e-42c3-8b8b-59169729c6c5" /> Subsequent trigger: input dialog with empty value (unexpected behavior): <img width="1350" height="680" alt="Image" src="https://github.com/user-attachments/assets/25373923-5271-446b-b398-8929def7ace8" /> ### Additional Information ### Problematic Code The issue appears to be caused by the changes introduced in commit [fb26be7](https://github.com/open-webui/open-webui/commit/fb26be7dd6295a429157e7b047ad1eb5b97e4003). The goal of this commit was to reset the confirm dialog input when showing it, in order to avoid accidentally sending a previous user value. However, this behavior has an unintended side effect: it **resets the value every time**, even when the input is intentionally prefilled during an `input` event call. ```typescript $: if (show) { init(); } const init = () => { inputValue = ''; }; ``` ### Proposed Solution Introduce a boolean variable in `src/lib/components/chat/Chat.svelte` to indicate whether the value is prefilled, and bind it to `ConfirmDialog.svelte`. ```typescript prefilled = !!data?.value; ``` Then, in `src/lib/components/common/ConfirmDialog.svelte`, reset the input value only if the boolean is false: ```typescript $: if (show && !prefilled) { init(); } ``` ### I can submit a pull request implementing this fix if needed.
GiteaMirror added the bugconfirmed issue labels 2026-04-25 09:36:35 -05:00
Author
Owner

@silentoplayz commented on GitHub (Mar 25, 2026):

I can confirm that I am able to reproduce this issue on the latest dev commit.

<!-- gh-comment-id:4127616345 --> @silentoplayz commented on GitHub (Mar 25, 2026): I can confirm that I am able to reproduce this issue on the latest `dev` commit.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#35398