mirror of
https://github.com/open-webui/open-webui.git
synced 2026-06-03 07:24:59 -05:00
[GH-ISSUE #22381] Pipe emit_message content not persisted to chat storage in v0.8.8 #35239
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 @JasmineBlake-Author on GitHub (Mar 8, 2026).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/22381
Bug Report: Pipe emit_message content not persisted to chat storage in v0.8.8
Environment
Bug Description
Custom pipe functions using
emit_message()execute correctly on the backend but the emitted content is not persisted to the chat message storage. The assistant message in the database has empty content (0 bytes) despite successful emit calls.Reproduction Steps
emit_message()to stream content:Execute the pipe via chat
Observe:
emit_messagebeing called successfully__current_event_emitter__is not None (type is<class 'function'>)Check database:
Expected Behavior
Content passed to
emit_message()should be:Actual Behavior
Evidence from Logs
The pipe executed 6 rounds of a multi-model conversation, all emits succeeded, but nothing was saved.
Database Evidence
Related Issues
Workaround Attempted
type: "replace"instead oftype: "message"- no changeImpact
This bug makes custom pipe functions unusable for any workflow that needs to persist conversation content. The pipe executes correctly but produces no visible or saved output.
Additional Context
@pr-validator-bot commented on GitHub (Mar 8, 2026):
⚠️ Missing Issue Title Prefix
@JasmineBlake-Author, your issue title is missing a prefix (e.g.,
bug:,feat:,docs:).Please update your issue title to include one of the following prefixes:
Example:
bug: Login fails when using special characters in password@Classic298 commented on GitHub (Mar 8, 2026):
Thank you for the detailed report and reproduction steps. This is a known architectural limitation with how pipes interact with the event persistence system, not a regression specific to v0.8.8.
Root Cause
The backend event emitter does persist
type: "message"events to the database — this part works correctly. However, after your pipe'spipe()method finishes executing, the frontend performs a full chat history save (viachatCompletedHandler), which writes the entire local message state back to the database.The problem is:
type: "message"events → backend writes it to the DB ✅None(no explicit return value) → the HTTP response carries no contentcontent: ""(or whatever accumulated via Socket.IO — which depends on timing)chatCompletedHandlerfires → saves the full localhistoryto the DB → overwrites the event-emitter-written content with the empty local stateThis explains exactly what you see: 277KB of chat JSON (the overall chat structure is saved), but the assistant message's
contentfield is empty (overwritten by the empty local state).Workaround
The fix is to return or yield your content from the
pipe()method instead of relying solely onemit_message:Events like
status,source,citation,files,embeds, andnotificationare safe to use alongside return/yield — they update separate fields that aren't affected by the content save.Documentation Update
We've updated the Events documentation to explicitly document this behavior.
The changes will go live soon.
The key takeaway: for Pipes, always deliver message content via return/yield. Use events for supplementary data (status, sources, files, notifications), not as the sole content delivery mechanism.