mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-16 14:39:31 -05:00
[GH-ISSUE #23950] issue: regression: Skills mentioned via $ in chat are never injected into the prompt in persisted chats #123433
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 @Methraen on GitHub (Apr 21, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/23950
Check Existing Issues
Installation Method
Git Clone
Open WebUI Version
v0.9.1
Ollama Version (if applicable)
No response
Operating System
Ubuntu 24.04.4
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
When a user selects a skill via the
$autocomplete in the chat composer and sends a message, the skill's full content should be injected into the system prompt as<skill name="...">...</skill>— regardless of whether the chat is persisted or temporary.Concretely, the frontend should include
skill_ids: ["<skill-id>"]in thePOST /api/chat/completionspayload, which triggers the backend logic inbackend/open_webui/utils/middleware.py(around lines 2468–2501) that resolves each skill and injects its content.Actual Behavior
In a persisted (non-temporary) chat,
skill_idsis never sent to the backend. The skill mention chip is correctly inserted in the composer and correctly serialized into the message content as<$skillId|label>, but the frontend fails to extract it before building the payload. As a result, the backend never injects the skill's content into the system prompt, and the model responds as if no skill were selected.The feature works only when Temporary Chat is enabled.
Root cause — in
src/lib/components/chat/Chat.svelteonmain(commit0a8a620f, tagv0.9.1):This was introduced by commit
18fe1712(2026-04-14, messagerefac), which moved_messages.map(...)insideif ($temporaryChatEnabled)without adapting the skill parsing block immediately below it. Before that commit (and since PR #21312 merged 2026-02-11), the array was populated unconditionally and the feature worked in all chat modes.Steps to Reproduce
format-mail, with any formatting instruction as content). Ensure it is active.$— the autocomplete menu opens and lists the skill.POST /api/chat/completions.Observation: the request body has no
skill_idsfield (orskill_ids: undefined), and the model's response does not follow the skill's instructions.Workaround: toggle Temporary Chat ON before step 2 — the skill is then injected and the model's response is correctly formatted.
Logs & Screenshots
Backend log (temporary
log.warningadded tobackend/open_webui/utils/middleware.pyat line 2469 for verification)→ confirms
skill_idsis not present in the request body received by the backend.Stored chat (from
GET /api/v1/chats/{id}) — mention is preserved but was never extracted(* 'cause I anonymized the user prompt)
The mention
<$format-mail|Format mail>is correctly present in the stored user message content, confirming that:RichTextInput.svelte) correctly emitted<$id|label>,skillMentionRegexinChat.svelteshould have matched it — but the regex was run against an empty/system-onlymessagesarray and never saw this content.Database state (PostgreSQL)
Skill is active and the user is its owner, so access control is not the cause.
Additional Information
No response
@tjbck commented on GitHub (Apr 24, 2026):
Addressed in dev.