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') {