Skip to content

Webui : fix location of pasted input within the user message - #23004

Closed
moaedy wants to merge 1 commit into
ggml-org:masterfrom
moaedy:godfix/issue-22962-run-38
Closed

moaedy wants to merge 1 commit into
ggml-org:masterfrom
moaedy:godfix/issue-22962-run-38

Conversation

@moaedy

@moaedy moaedy commented May 13, 2026 •

Copy link
Copy Markdown

Overview

Fix the location of pasted input within the user message. ChatService.convertDbMessageToApiChatMessageData pushed message.content onto contentParts before the attachment parts, so a "Pasted" text attachment was appended after the typed instruction.

Additional information

Reordered the contentParts assembly so images, text/legacy/audio/PDF files and MCP prompts/resources are pushed first, with message.content emitted last. This keeps the typed query trailing the pasted/uploaded data and keeps the attachment payload at a stable prefix position for cache reuse.

Added tools/server/webui/tests/unit/chat-service-attachment-order.test.ts covering the ordering.

Fixes #22962

Requirements

@moaedy
moaedy requested a review from a team as a code owner May 13, 2026 07:21
@moaedy moaedy closed this May 13, 2026
@moaedy
moaedy deleted the godfix/issue-22962-run-38 branch May 13, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

webui : fix location of pasted input within the user message

1 participant