Files
open-webui/backend/open_webui/utils
2e7df54673 fix: surface attached chat references in <attached_files> (#28788)
A chat attached via the "+" menu or dropped from the sidebar references an
existing chat by id and carries no url. add_file_context() filtered on
`file.get('url')`, so the reference was dropped from <attached_files>
entirely and the model was never told it existed.

When the RAG file-context path is enabled the chat content still reaches
the model as <source> context, which masked this. With file_context
disabled that path is skipped, and get_attached_knowledge() only promotes
collection/note items into <attached_knowledge> - so an attached chat was
visible in the UI but invisible to the model, which then reported having
no chat attachments despite having a view_chat tool available.

Keep chat references and emit their id so the model can resolve them with
view_chat. The url attribute is now conditional, since a chat has none;
the id guard it replaces was dead once the filter guarantees a url or a
chat id.

Co-authored-by: Claude <noreply@anthropic.com>
2026-08-19 11:15:22 -07:00
..
2026-07-31 17:41:14 -04:00
2026-08-13 21:02:17 -06:00
2026-08-13 16:42:10 -06:00
2026-07-31 17:30:47 -04:00
2026-07-26 21:12:14 -04:00
2026-07-31 17:41:14 -04:00
2026-07-31 17:41:14 -04:00
2026-08-17 00:57:57 -07:00
2026-07-27 00:12:47 -04:00
2026-08-10 19:28:21 -06:00
2026-07-26 23:09:22 -04:00
2026-08-13 00:07:31 -06:00
2026-07-27 19:39:36 -04:00
2026-08-16 22:56:19 -07:00
2026-08-17 00:57:57 -07:00
2026-07-27 04:17:00 -04:00
2026-08-10 20:13:03 -06:00
2026-08-08 15:47:10 -06:00
2026-08-16 22:52:24 -07:00
2026-07-27 19:39:36 -04:00
2026-07-31 17:41:14 -04:00