fix canvas agent defaults and video billing
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled

This commit is contained in:
Your Name 2026-03-08 21:23:22 +08:00
parent 76c684ff82
commit 1a80812c4f
2 changed files with 6 additions and 4 deletions

View File

@ -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"}
/>
</div>

View File

@ -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);