From a752737327e62641e5fdd96ed95bd9cccb92f320 Mon Sep 17 00:00:00 2001 From: 134 Date: Tue, 23 Jun 2026 20:13:35 +0800 Subject: [PATCH] fix: suppress image loading for canvas control prompts --- components/canvas/CanvasChatPanel.tsx | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index c255a8afa..c9522cc2e 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -8585,7 +8585,18 @@ export function CanvasChatPanel({ } textContent = clampChatRequestText(textContent, MAX_CHAT_TEXT_PART_LENGTH); const requestModel = allModels.find((model) => model.id === effectiveModelId); + const shouldTreatAsCanvasAgentControlIntent = + shouldBypassCanvasImagePointsPrecheckForAgentControl({ + text: textContent, + activeComposerMode: effectiveComposerMode, + attachmentCount: effectiveAttachments.length, + hasSkillTag: Boolean(selectedSkillTag), + hasWorkflowContext, + isDetailGenerationMode, + agentEnabled: effectiveAgentEnabled, + }); const shouldShowOptimisticImageGeneration = + !shouldTreatAsCanvasAgentControlIntent && effectiveComposerMode === "image" && Boolean(requestModel && isCanvasImageModel(requestModel)); @@ -8767,6 +8778,7 @@ export function CanvasChatPanel({ clearAgentProgressStateForChat, setStreamImageGenerationStateForChat, computedComposerMode, + effectiveAgentEnabled, releaseSendGuard, setSendGuard, shouldBlockDuplicateSend,