diff --git a/src/config/settings.ts b/src/config/settings.ts index 6299547..769cece 100644 --- a/src/config/settings.ts +++ b/src/config/settings.ts @@ -8,7 +8,7 @@ import * as vscode from "vscode"; type Environment = "dev" | "test" | "prod"; /** 当前环境 - 修改这里切换环境 */ -const CURRENT_ENV: Environment = "test"; +const CURRENT_ENV: Environment = "dev"; /** 配置项接口 */ export interface IccoderConfig { @@ -25,7 +25,7 @@ const ENV_CONFIG: Record = { /** 本地开发环境 */ dev: { backendUrl: "http://localhost:2233", - timeout: 60000, + timeout: 300000, // 5分钟,与子智能体超时一致 userId: "default-user", }, /** 测试服务器环境 */ diff --git a/src/utils/messageHandler.ts b/src/utils/messageHandler.ts index a173fb6..3ea034d 100644 --- a/src/utils/messageHandler.ts +++ b/src/utils/messageHandler.ts @@ -127,18 +127,20 @@ async function handleUserMessageWithBackend( mode?: RunMode, reuseTaskId?: string // 可选,复用现有 taskId(用于 Plan 模式确认后继续执行) ): Promise { + const historyManager = ChatHistoryManager.getInstance(); + + // 获取 historyManager 中的 taskId(由 ICHelperPanel 创建) + // 优先使用 reuseTaskId,其次使用 historyManager 的 taskId + const taskIdToUse = reuseTaskId || historyManager.getCurrentTaskId(); + // 创建或复用会话 if (!currentSession || !currentSession.active) { - currentSession = dialogManager.createSession(extensionPath, reuseTaskId); + currentSession = dialogManager.createSession(extensionPath, taskIdToUse || undefined); // 保存 taskId 用于后续操作(如压缩) lastTaskId = currentSession.getTaskId(); - if (reuseTaskId) { - console.log("[MessageHandler] 复用 taskId 创建会话:", reuseTaskId); - } + console.log("[MessageHandler] 创建会话: taskId=", lastTaskId, "来源=", taskIdToUse ? "historyManager" : "新生成"); } - const historyManager = ChatHistoryManager.getInstance(); - // 显示状态栏 panel.webview.postMessage({ command: "updateStatus", @@ -196,10 +198,6 @@ async function handleUserMessageWithBackend( // 最后一次发送完整的段落 console.log("[MessageHandler] 对话完成, 段落数:", segments.length); - console.log( - "[MessageHandler] segments 内容:", - JSON.stringify(segments) - ); const result = await panel.webview.postMessage({ command: "updateSegments", diff --git a/src/views/agentCard.ts b/src/views/agentCard.ts index 2783cd7..0b3a17e 100644 --- a/src/views/agentCard.ts +++ b/src/views/agentCard.ts @@ -126,7 +126,11 @@ export function getAgentCardScript(): string { 'addPlan': '添加计划', 'addEdge': '添加边', 'showPlan': '显示计划', - 'spawnExplorer': '代码探索' + 'spawnExplorer': '代码探索', + 'spawnDebugger': '波形调试', + 'queryByBFS': 'BFS查询', + 'queryStateTransitions': '查询状态转移', + 'addStateTransition': '添加状态转移' }; return toolNameMap[toolName] || toolName; }