fix(core): 初始化 Task 工具上下文,修复子 Agent 无法启动的问题

This commit is contained in:
2025-12-16 11:56:12 +08:00
parent 6817aebfc4
commit 7f51d33319
+3
View File
@@ -28,6 +28,7 @@ import {
DOOM_LOOP_WARNING,
} from './doom-loop.js';
import { todoManager } from '../tools/todo/todo-manager.js';
import { initTaskContext } from '../tools/task/index.js';
/**
* 工具调用开始事件信息
@@ -169,6 +170,8 @@ export class Agent {
this.sessionManager = manager;
// 初始化 todoManager,使其能够访问会话数据
todoManager.setSessionManager(manager);
// 初始化 Task 工具上下文(使子 Agent 能够正常工作)
initTaskContext(this.config, manager);
// 从会话恢复状态
const session = manager.getSession();
if (session) {