mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-14 05:02:01 -06:00
[GH-ISSUE #16966] issue: better error handling for defective citation/source events from tools/pipes in Frontend #121426
Reference in New Issue
Block a user
Originally created by @Podden on GitHub (Aug 27, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/16966
Check Existing Issues
Installation Method
Docker
Open WebUI Version
0.6.25
Ollama Version (if applicable)
No response
Operating System
Ubuntu 22.04
Browser (if applicable)
No response
Confirmation
README.md.Expected Behavior
I'm experimenting with imported tools and pipes and sometimes there are malformed source/citation events (documentation on this is very vague, it just says "# Open WebUI Code Source (Citation) Object") and noticed that the frontend get's completly unresponsive and the conversations cant be opened anymore if there is a problematic citation or source (for example without "document" key.
Maybe defective citations can just be skipped while loading so I still can open the conversation?
Uncaught (in promise) TypeError: can't access property "forEach", S.document is undefined o Citations.svelte:54 update Citations.svelte:53 ln Component.js:144 Ra Citations.svelte:95 Bs ResponseMessage.svelte:853 xo ResponseMessage.svelte:849 Ys ResponseMessage.svelte:737 Df ResponseMessage.svelte:596 ln Component.js:148 nl ResponseMessage.svelte:567 bu Message.svelte:104 Ln Message.svelte:73 ku Message.svelte:52 ln Component.js:148 Iu Message.svelte:44 Xn Messages.svelte:431 $n Messages.svelte:425 Wu Messages.svelte:406 Gu Messages.svelte:402 ln Component.js:148 jc Messages.svelte:92 ice Chat.svelte:2292 sce Chat.svelte:2261 ae utils.js:165 Sa pane-group.svelte:44 ln Component.js:148 le pane.svelte:76 rce Chat.svelte:2219 ae utils.js:165 ja ctx.js:17 ln Component.js:148 ue pane-group.svelte:44 tce Chat.svelte:2185 p Chat.svelte:2159 Vt scheduler.js:119 vt scheduler.js:79 promise callback*wt scheduler.js:20 ee Component.js:81 ctx Component.js:139 Be Chat.svelte:172 update Chat.svelte:152 ln Component.js:144 T0e Chat.svelte:224 h Immutable ln Component.js:148 I +page.svelte:7 Re dom.js:1228 p root.svelte:57 p root.svelte:51 ue utils.js:203 p +layout.svelte:347 p +layout.svelte:284 p +layout.svelte:353 p +layout.svelte:276 Vt scheduler.js:119 vt scheduler.js:79 promise callback*wt scheduler.js:20 ee Component.js:81 ctx Component.js:139 $$set root.svelte:69 $set Component.js:507 W client.js:1595 Bn client.js:2383 Bn client.js:2274 Xn client.js:339 async* (index):123 promise callback* (index):122Actual Behavior
OpenWebUI becomes completely unclickable until i refresh the page to a working conversation (or home screen)
Steps to Reproduce
Start a new Conversation, use a Tool or Pipe or Filter which does not create a correct source/citation object. Try to open the conversation again.
Logs & Screenshots
Uncaught (in promise) TypeError: can't access property "forEach", S.document is undefined
o Citations.svelte:54
update Citations.svelte:53
ln Component.js:144
Ra Citations.svelte:95
Bs ResponseMessage.svelte:853
xo ResponseMessage.svelte:849
Ys ResponseMessage.svelte:737
Df ResponseMessage.svelte:596
ln Component.js:148
nl ResponseMessage.svelte:567
bu Message.svelte:104
Ln Message.svelte:73
ku Message.svelte:52
ln Component.js:148
Iu Message.svelte:44
Xn Messages.svelte:431
$n Messages.svelte:425
Wu Messages.svelte:406
Gu Messages.svelte:402
ln Component.js:148
jc Messages.svelte:92
ice Chat.svelte:2292
sce Chat.svelte:2261
ae utils.js:165
Sa pane-group.svelte:44
ln Component.js:148
le pane.svelte:76
rce Chat.svelte:2219
ae utils.js:165
ja ctx.js:17
ln Component.js:148
ue pane-group.svelte:44
tce Chat.svelte:2185
p Chat.svelte:2159
Vt scheduler.js:119
vt scheduler.js:79
promise callbackwt scheduler.js:20
ee Component.js:81
ctx Component.js:139
Be Chat.svelte:172
update Chat.svelte:152
ln Component.js:144
T0e Chat.svelte:224
h Immutable
ln Component.js:148
I +page.svelte:7
Re dom.js:1228
p root.svelte:57
p root.svelte:51
ue utils.js:203
p +layout.svelte:347
p +layout.svelte:284
p +layout.svelte:353
p +layout.svelte:276
Vt scheduler.js:119
vt scheduler.js:79
promise callbackwt scheduler.js:20
ee Component.js:81
ctx Component.js:139
$$set root.svelte:69
$set Component.js:507
W client.js:1595
Bn client.js:2383
Bn client.js:2274
Xn client.js:339
async* (index):123
promise callback* (index):122
Additional Information
No response
@rgaricano commented on GitHub (Aug 27, 2025):
For reference,
replace?
https://github.com/open-webui/open-webui/blob/1db8dec4f52fc0fa8f8f7bfbb8ea5bde41fee17d/src/lib/components/chat/Messages/Citations.svelte#L58
by
source.document?.forEach((document, index) => {@Podden commented on GitHub (Aug 27, 2025):
Enough for me.
Is there some kind of validator on the tool/function loading side? Maybe it's better to just dont allow tools with wrong event payloads.
I'll make a PR for the docs in the next days to clear up what the payload of source/citation should contain.
@rgaricano commented on GitHub (Aug 27, 2025):
Yes, there are some validators, but always can be increased ;)
For Reference,
Tool Validator
https://github.com/open-webui/open-webui/blob/1db8dec4f52fc0fa8f8f7bfbb8ea5bde41fee17d/backend/open_webui/routers/tools.py#L222-L223
function, add in e.g. L232
https://github.com/open-webui/open-webui/blob/1db8dec4f52fc0fa8f8f7bfbb8ea5bde41fee17d/backend/open_webui/utils/tools.py#L468-L471
https://github.com/open-webui/open-webui/blob/1db8dec4f52fc0fa8f8f7bfbb8ea5bde41fee17d/backend/open_webui/utils/tools.py#L535-L542
https://github.com/open-webui/open-webui/blob/1db8dec4f52fc0fa8f8f7bfbb8ea5bde41fee17d/src/routes/(app)/workspace/tools/create/%2Bpage.svelte#L17-L20
XXX
@tjbck commented on GitHub (Aug 27, 2025):
dca7ce9420