fix: 修复"当前有对话正在进行中"错误
问题:当 currentSession.active 为 true 时,条件判断阻止了 dialogManager.createSession() 的调用,导致无法中止旧会话。 修复:移除条件判断,始终通过 dialogManager 创建会话, 让其内部自动处理旧会话的中止。
This commit is contained in:
@ -159,13 +159,11 @@ async function handleUserMessageWithBackend(
|
||||
// 优先使用 reuseTaskId,其次使用 historyManager 的 taskId
|
||||
const taskIdToUse = reuseTaskId || historyManager.getCurrentTaskId();
|
||||
|
||||
// 创建或复用会话
|
||||
if (!currentSession || !currentSession.active) {
|
||||
// 创建会话(dialogManager 会自动处理旧会话的中止)
|
||||
currentSession = dialogManager.createSession(extensionPath, taskIdToUse || undefined);
|
||||
// 保存 taskId 用于后续操作(如压缩)
|
||||
lastTaskId = currentSession.getTaskId();
|
||||
console.log("[MessageHandler] 创建会话: taskId=", lastTaskId, "来源=", taskIdToUse ? "historyManager" : "新生成");
|
||||
}
|
||||
|
||||
// 显示状态栏
|
||||
panel.webview.postMessage({
|
||||
|
||||
Reference in New Issue
Block a user