修复: DeepSeek 400 全量扫描 + 队列 per-conv 隔离

- openai_compat: 扫描所有 assistant 消息剥离 orphan tool_calls(原仅查末条)
- queue 加 conversationId 字段,按会话精准 drain
- regenerate/editMessage 只清本会话排队消息
- newConversation 保留旧会话排队消息
- AiError 只清出错会话的队列项
This commit is contained in:
lxy
2026-07-20 00:19:50 +08:00
parent 42efb31bbf
commit e9e3578d26
59 changed files with 2875 additions and 1330 deletions
+11
View File
@@ -21,6 +21,7 @@
//! streaming 是 boolean 无真正非法跃迁,guard 价值在集中入口与日志而非拦截。
import { state } from '@/stores/ai'
import { convStates } from './aiShared'
import { useAppSettingsStore } from '@/stores/appSettings'
/// feature flag key(appSettings KV)。关=回退散布语义(灰度/回退用)。
@@ -100,4 +101,14 @@ export function forceResetStreaming(reason: string, convId?: string): void {
setStreaming(false, { convId: convId ?? null, reason })
state.currentText = ''
state.queue = []
// BUG-2026-07-17 根治:同时清理 convStates 项。
// 原实现仅清 streaming/currentText/queue,但按钮 stopBtnState 优先读 convStates
// (ChatInput.vue:243),convStates=generating 时仍显红色停止按钮。后端未发
// AiConvStateChanged 时(conv_state 永久卡住),必须前端主动清 convStates 才能解锁 UI。
if (convId) {
convStates.delete(convId)
} else {
// 全局兜底:无 convId 时清所有生成态(卡死恢复场景,精确性不重要)
convStates.clear()
}
}