diff --git a/backend/open_webui/models/messages.py b/backend/open_webui/models/messages.py index 8b031404e6..cdc51f0139 100644 --- a/backend/open_webui/models/messages.py +++ b/backend/open_webui/models/messages.py @@ -113,14 +113,19 @@ class MessageUserResponse(MessageModel): class MessageUserSlimResponse(MessageUserResponse): - data: bool | None = None + data: dict | bool | None = None @field_validator('data', mode='before') - def convert_data_to_bool(cls, v): + def summarize_data(cls, v): # No data or not a dict → False if not isinstance(v, dict): return False + # Reply previews need card text, but not actions or other message data. + app = v.get('app') + if isinstance(app, dict) and app.get('embeds'): + return {'app': {'embeds': app['embeds']}} + # True if ANY value in the dict is non-empty return any(bool(val) for val in v.values()) diff --git a/src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens/MentionToken.svelte b/src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens/MentionToken.svelte index e808d78328..5efc5f5425 100644 --- a/src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens/MentionToken.svelte +++ b/src/lib/components/chat/Messages/Markdown/MarkdownInlineTokens/MentionToken.svelte @@ -107,7 +107,10 @@ browser && idType === 'U' && requestedUserId !== id && - (!token?.label || token.label === id || /^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(token.label)) + (!token?.label || + token.label === _id || + token.label === id || + /^[0-9a-f]{8}-[0-9a-f-]{27}$/i.test(token.label)) ) { requestedUserId = id; resolvedUser = null;