From 8da4a596ebf510bf6d0e665fb360f29facf6b9a2 Mon Sep 17 00:00:00 2001 From: JOJO <1498581755@qq.com> Date: Wed, 12 Aug 2026 11:23:06 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20=E7=A9=BA=E5=AF=B9=E8=AF=9D?= =?UTF-8?q?=E4=B8=8E=E6=98=BE=E5=BC=8F=E6=96=B0=E5=BB=BA=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E4=B8=8B=20has=5Fimages/has=5Fvideos=20=E4=B8=8D=E5=BA=94?= =?UTF-8?q?=E7=94=A8=E6=AE=8B=E7=95=99=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit status 中的值来自 terminal 残留的旧对话上下文,空对话语义上无图片/视频, 直接置 false,否则误拦 handleModelSelect 的图片/视频能力检查。 --- static/src/app/methods/conversation/state.ts | 1 + static/src/app/methods/resources.ts | 19 ++++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/static/src/app/methods/conversation/state.ts b/static/src/app/methods/conversation/state.ts index 0a93946b..98d81740 100644 --- a/static/src/app/methods/conversation/state.ts +++ b/static/src/app/methods/conversation/state.ts @@ -107,6 +107,7 @@ export const stateMethods = { this.imageEntries = []; this.imageLoading = false; this.conversationHasImages = false; + this.conversationHasVideos = false; this.toolSetSettingsLoading(false); this.toolSetSettings([]); this.pendingToolApprovals = []; diff --git a/static/src/app/methods/resources.ts b/static/src/app/methods/resources.ts index 66d08903..99ea12da 100644 --- a/static/src/app/methods/resources.ts +++ b/static/src/app/methods/resources.ts @@ -189,11 +189,20 @@ export const resourceMethods = { } else { this.pendingExecutionMode = ''; } - if (status && typeof status.has_images !== 'undefined') { - this.conversationHasImages = !!status.has_images; - } - if (status && typeof status.has_videos !== 'undefined') { - this.conversationHasVideos = !!status.has_videos; + // has_images/has_videos 遵循与上面模型/运行模式相同的权威规则: + // 有打开对话时才从 status 同步;空对话/显式新建路由(/new)上 status 里的值 + // 是 terminal 残留的旧对话上下文,不能应用——空对话语义上无图片/视频, + // 直接置 false,否则会误拦 handleModelSelect 的图片/视频能力检查。 + if (hasConversation && !onExplicitNewRoute) { + if (status && typeof status.has_images !== 'undefined') { + this.conversationHasImages = !!status.has_images; + } + if (status && typeof status.has_videos !== 'undefined') { + this.conversationHasVideos = !!status.has_videos; + } + } else { + this.conversationHasImages = false; + this.conversationHasVideos = false; } const compression = status?.conversation?.compression; if (compression && typeof compression === 'object') {