mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 08:21:12 -05:00
[PR #24971] fix: avoid empty prompt for skill-only messages #131621
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?
📋 Pull Request Information
Original PR: https://github.com/open-webui/open-webui/pull/24971
Author: @pragnyanramtha
Created: 5/21/2026
Status: 🔄 Open
Base:
dev← Head:pragnyan/fix-empty-skill-only-message-24929-v2📝 Commits (1)
ce9f4f2fix: avoid empty prompt for skill-only messages📊 Changes
1 file changed (+34 additions, -15 deletions)
View changed files
📝
backend/open_webui/utils/middleware.py(+34 -15)📄 Description
Pull Request Checklist
Note to first-time contributors: Please open a discussion post in Discussions to discuss your idea/fix with the community before creating a pull request, and describe your changes before submitting a pull request.
This is a small bug fix for an existing issue.
Before submitting, make sure you've checked the following:
devbranch.dev, and contains no unrelated commits.fixprefix.Changelog Entry
Description
Added
Changed
<$skill|label>mention stripping, so strict providers do not receive a blank final user message.Deprecated
Removed
Fixed
Security
Breaking Changes
Additional Information
Closes #24929.
This replaces #24968, which was closed because the PR body did not include the required CLA template text. The code also addresses the Copilot review edge case from that PR: if the selected skill is inactive or unavailable, the backend still inserts a neutral non-empty fallback instead of allowing an empty content block through.
Validation:
python3 -m py_compile backend/open_webui/utils/middleware.pyuvx ruff format --check backend/open_webui/utils/middleware.pygit diff --checkNote:
uvx ruff check backend/open_webui/utils/middleware.pystill reports pre-existing import, complexity, and line-length issues across this large file that are unrelated to this change.Screenshots or Videos
Contributor License Agreement
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.