From 1a80812c4f492873accccae92a4e54c0435f83d4 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sun, 8 Mar 2026 21:23:22 +0800 Subject: [PATCH] fix canvas agent defaults and video billing --- components/canvas/CanvasChatPanel.tsx | 7 +++---- lib/ai/tools/generate-video.ts | 3 +++ 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/components/canvas/CanvasChatPanel.tsx b/components/canvas/CanvasChatPanel.tsx index 5e9139c14..5a8068a2c 100644 --- a/components/canvas/CanvasChatPanel.tsx +++ b/components/canvas/CanvasChatPanel.tsx @@ -2946,10 +2946,8 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF // 默认选择模型(根据系统设置) useEffect(() => { if (!selectedModelId && siteSettings) { - // 使用系统设置的默认模型,如果没有设置则使用Agent模式 - const defaultModel = siteSettings.canvasDefaultModelId || "auto"; - currentModelIdRef.current = defaultModel; - setSelectedModelId(defaultModel); + currentModelIdRef.current = "auto"; + setSelectedModelId("auto"); } }, [selectedModelId, siteSettings]); @@ -8850,6 +8848,7 @@ export function CanvasChatPanel({ chatId, initialMessages = [], onClose, onOpenF inline={true} providerType={currentModel?.providerType} imageGenConfig={currentModel?.imageGenConfig || undefined} + hideImageCount={activeComposerMode === "agent"} hideAdvancedOptions={activeComposerMode === "image"} /> diff --git a/lib/ai/tools/generate-video.ts b/lib/ai/tools/generate-video.ts index 43a98d8d1..9df6b230f 100644 --- a/lib/ai/tools/generate-video.ts +++ b/lib/ai/tools/generate-video.ts @@ -430,6 +430,9 @@ export function generateVideo({ dataStream }: { dataStream: any }) { success: true, videoUrl: result.videoUrl, metadata: result.metadata, + modelDisplayName: result.modelDisplayName, + modelId: result.modelId, + modelRef: result.modelRef, }; } catch (error: any) { console.error("[Generate Video Tool] ❌ 生成失败:", error);