fix(core): 初始化 Task 工具上下文,修复子 Agent 无法启动的问题
This commit is contained in:
@@ -28,6 +28,7 @@ import {
|
|||||||
DOOM_LOOP_WARNING,
|
DOOM_LOOP_WARNING,
|
||||||
} from './doom-loop.js';
|
} from './doom-loop.js';
|
||||||
import { todoManager } from '../tools/todo/todo-manager.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;
|
this.sessionManager = manager;
|
||||||
// 初始化 todoManager,使其能够访问会话数据
|
// 初始化 todoManager,使其能够访问会话数据
|
||||||
todoManager.setSessionManager(manager);
|
todoManager.setSessionManager(manager);
|
||||||
|
// 初始化 Task 工具上下文(使子 Agent 能够正常工作)
|
||||||
|
initTaskContext(this.config, manager);
|
||||||
// 从会话恢复状态
|
// 从会话恢复状态
|
||||||
const session = manager.getSession();
|
const session = manager.getSession();
|
||||||
if (session) {
|
if (session) {
|
||||||
|
|||||||
Reference in New Issue
Block a user