mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 23:21:44 -05:00
[GH-ISSUE #22913] issue: Chat input loses skill and @ model selection state on page refresh #90581
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 @silentoplayz on GitHub (Mar 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22913
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.8.10
Ollama Version (if applicable)
v0.18.0
Operating System
Ubuntu 24.04.4 LTS
Browser (if applicable)
Mozilla Firefox Snap for Ubuntu v148.0.2 (64-bit) / Google Chrome v146.0.7680.80 (Official Build) (64-bit)
Confirmation
README.md.Expected Behavior
When typing in the chat input with a skill selected (via the
$trigger) or a model selected via the@mention trigger, refreshing the page should preserve these UI selection states alongside the existing text input draft restoration. Specifically:$to trigger the skill suggestion dropdown and selecting a skill, refreshing the page should retain the active skill selection and its visual highlighting in the input area.@Model Selection: After typing@to trigger the model suggestion dropdown and selecting a specific model, refreshing the page should retain the selected model's highlighted/active state in the input.Currently, the text content (
prompt) is correctly restored fromsessionStorageon page reload, but the skill and@model selection states are silently discarded.Actual Behavior
After selecting a skill via
$or a model via@, if the page is refreshed:$text remains in the input (as plain text), but the skill selection state is lost. The skill's active/highlighted state disappears, and the skill suggestion dropdown is no longer active.@Model Selection: The@text remains in the input (as plain text), but the selected model state (atSelectedModel) is cleared. The model suggestion dropdown's active selection is lost.Both states appear to be transient — they exist in Svelte component memory but are never written to
sessionStorageorlocalStorage, so they are not restored on page reload.Steps to Reproduce
a. In the chat input, type
$to trigger the skill suggestion dropdown.b. Select a skill from the dropdown.
c. Observe the skill is active/highlighted in the input area.
d. Press F5 or refresh the page.
e. Observe the
$skillnametext remains in the input, but the skill's active/highlighted state is gone.@Model Selection:a. In the chat input, type
@to trigger the model suggestion dropdown.b. Select a model from the dropdown.
c. Observe the model is selected and the input shows
@model-name.d. Press F5 or refresh the page.
e. Observe the model's selected/active state is cleared.
a. Type some regular text in the chat input.
b. Refresh the page.
c. Confirm the typed text IS restored (existing draft restoration works).
Logs & Screenshots
Before page refresh (skill selected): Screenshot shows skill
$some-skillhighlighted/active in the input.After page refresh (skill state lost): Screenshot shows
$some-skilltext still present but skill highlight/suggestion dropdown state lost.Before page refresh (
@model selected): Screenshot shows the model highlighted.After page refresh (
@model state lost): Screenshot shows the model suggestion dropdown's active selection cleared.No console errors are produced — this is a silent state loss, not a crash.
Additional Information
Root Cause Analysis
The chat input draft is persisted to
sessionStoragevia thesaveDraft()function insrc/lib/components/chat/Chat.svelte(lines 2581-2596). The draft object is assembled insrc/lib/components/chat/MessageInput.sveltevia theonChangereactive statement (lines 157-173):The following state is NOT included in the draft and therefore not persisted across page reloads:
promptfilesselectedToolIds,selectedFilterIdsselectedToolIds,selectedFilterIdsonChangepayload and draft restore block, but may be overridden by model-default tools before restore fireswebSearchEnabled,imageGenerationEnabled,codeInterpreterEnabled@model selectionatSelectedModel$skill active statecommand(transient skill tracking)Relevant Files
src/lib/components/chat/MessageInput.svelte— TheonChangereactive handler (lines 157-173) needs to includeatSelectedModelandcommandin the draft object.src/lib/components/chat/Chat.svelte— The draft restoration logic (around lines 225-250) needs to restoreatSelectedModelandcommandalongside the existing fields.Additional Bug: Tool/Filter Toggles May Also Not Persist
Upon further investigation,
selectedToolIds,selectedFilterIds,webSearchEnabled,imageGenerationEnabled, andcodeInterpreterEnabledare included in theonChangedraft object (MessageInput.svelte lines 168-172) and appear in the draft restore block (Chat.svelte lines 240-244). However, in theinit()function,selectedToolIdsis first set by the model-auto-selection reactive statement (frommodel?.info?.meta?.toolIds) before the draft restore block runs, which could cause model-default tools to override any restored draft tools. This requires further investigation and manual testing to confirm whether tool/filter toggles reliably persist across page reloads.Suggested Fix
MessageInput.svelte: AddatSelectedModelandcommandto theonChangedraft object so they are saved tosessionStorage.Chat.svelte: ExtractatSelectedModelandcommandfrom the parsed draft JSON and restore them via themessageInputcomponent's prop bindings (similar to howprompt,files,selectedToolIds, etc. are already restored).init()reactive statement firing before draft restore) is causing tool state to be lost, and addatSelectedModelto the draft and restore blocks as well.@tjbck commented on GitHub (Mar 24, 2026):
atSelectedModelis intended to be ephemeral. $skills rendering issue fixed.@silentoplayz commented on GitHub (Mar 24, 2026):
$skills also appears to be ephemeral now (disappears from the message input field on a page refresh). Is this intended?