mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #24929] issue: Selecting a skill ($) without additional text sends empty user message, causing API errors #123744
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 @JustinJohnWilliams on GitHub (May 19, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/24929
Check Existing Issues
Installation Method
Docker
Open WebUI Version
v0.9.5
Ollama Version (if applicable)
N/A
Operating System
Amazon Linux 2023 (ECS Fargate) / macOS Sequoia (reproducible on both)
Browser (if applicable)
Chrome 136
Confirmation
README.md.Expected Behavior
When a user selects a skill via
$skill-namein the chat composer and sends the message without typing additional text, the message should either:The skill's system prompt injection should be sufficient context for the model to respond.
Actual Behavior
After
strip_skill_mentions()removes the<$skillId|label>tag from the user message content, the resulting message is an empty string"". This empty content block is sent to the model API, which causes a400 ValidationExceptionon providers that reject empty content blocks (e.g., AWS Bedrock ConverseStream API):Steps to Reproduce
ghcr.io/open-webui/open-webui:v0.9.5)$and select the skill from the autocomplete dropdownValidationExceptionerrorRoot Cause
In
backend/open_webui/utils/middleware.pyline 2587:The
strip_skill_mentions()function (line 2225) removes the<$...|...>tags and.strip()s the result. If the user only selected a skill and typed nothing else, this produces an empty string. There is no guard after this point to handle the empty message case before it's sent to the model.Filters and pipelines cannot address this because they execute before
strip_skill_mentions()runs (line 2464 vs. 2587).Suggested Fix
After
strip_skill_mentions()on line 2587, check if the last user message is empty and set a minimal default:Alternatively, the frontend could prevent form submission when the editor content consists solely of a skill mention node with no other text.
Logs & Screenshots
No relevant browser console errors — the error is returned from the backend API response.
Additional Information
Related issues:
Environment details: