]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commitdiff
Fix agentic mcp image single model (#20339)
authorPascal <redacted>
Wed, 11 Mar 2026 04:31:33 +0000 (05:31 +0100)
committerGitHub <redacted>
Wed, 11 Mar 2026 04:31:33 +0000 (05:31 +0100)
* webui: fix MCP image attachments dropped during the agentic loop in single-model mode

* chore: update webui build output

tools/server/public/index.html.gz
tools/server/webui/src/lib/stores/agentic.svelte.ts

index ed3fc127b77e15c90041ca89457b3989a07021c7..3d0991dde0f1555bf82ba12fc81c17dc8fa588b8 100644 (file)
Binary files a/tools/server/public/index.html.gz and b/tools/server/public/index.html.gz differ
index a6dd8581e7653af142973b701cb2bc49a41f3c22..f8834f9df3f9229ee17b0915f8bab9b12469e16b 100644 (file)
@@ -318,6 +318,12 @@ class AgenticStore {
                const maxTurns = agenticConfig.maxTurns;
                const maxToolPreviewLines = agenticConfig.maxToolPreviewLines;
 
+               // Resolve effective model for vision capability checks.
+               // In ROUTER mode, options.model is always set by the caller.
+               // In MODEL mode, options.model is undefined; use the single loaded model
+               // which carries modalities bridged from /props.
+               const effectiveModel = options.model || modelsStore.models[0]?.model || '';
+
                for (let turn = 0; turn < maxTurns; turn++) {
                        this.updateSession(conversationId, { currentTurn: turn + 1 });
                        agenticTimings.turns = turn + 1;
@@ -571,14 +577,14 @@ class AgenticStore {
                                ];
                                for (const attachment of attachments) {
                                        if (attachment.type === AttachmentType.IMAGE) {
-                                               if (modelsStore.modelSupportsVision(options.model ?? '')) {
+                                               if (modelsStore.modelSupportsVision(effectiveModel)) {
                                                        contentParts.push({
                                                                type: ContentPartType.IMAGE_URL,
                                                                image_url: { url: (attachment as DatabaseMessageExtraImageFile).base64Url }
                                                        });
                                                } else {
                                                        console.info(
-                                                               `[AgenticStore] Skipping image attachment (model "${options.model}" does not support vision)`
+                                                               `[AgenticStore] Skipping image attachment (model "${effectiveModel}" does not support vision)`
                                                        );
                                                }
                                        }