8 Commits

Author SHA1 Message Date
oudecheng
6a496ce212 feat(task): 优化孙智能体任务消息的发送与工具注册
- 在发送任务消息时增加可选的任务仓库参数支持子任务重发
- 新增 extract_parent_task_id 函数用于提取孙智能体的父任务 ID
- 补发子任务(孙智能体)的 TaskStarted 事件,解决视图重进导致的 navigateToTaskId 丢失
- 判断并附加子任务的父任务 ID,完善日志记录与事件发送
- 在子智能体运行时根据深度排除 task 工具,防止无限嵌套调用
- ToolRegistry 新增 without 方法,可创建排除指定工具的新实例用于子智能体配置
2026-06-22 11:31:41 +08:00
oudecheng
2607ca4aa4 refactor(task): 优化任务工具和子代理深度管理
- 在 AgentContext 中新增 task_id 字段,用于标识当前智能体任务 ID
- 统一 TaskTool 构造函数,使用 Option<u32> 表示最大嵌套深度限制
- 调整子代理工具注册,适配新的 TaskTool 构造函数
- 修改子代理运行时创建逻辑,传递并设置 task_id 和 parent_task_id
- 删除重复的 task_id 提取函数,改用传递参数进行关联
- 深度校验改为判断 Option,支持无深度限制和有限层数
- 增强子代理间的任务层级关联,正确传递 parent_task_id 元数据
2026-06-18 11:41:40 +08:00
oudecheng
879f5f243a feat(task): 增加子代理最大嵌套深度支持,更新相关文档和提示 2026-06-17 17:55:22 +08:00
oudecheng
631c61fea2 feat(agent): 支持子代理最大嵌套深度控制
- 在配置结构体中新增 max_nesting_depth 字段,设置子代理最大嵌套深度
- 在 AgentFactory、todo_read、todo_write 等处初始化 nesting_depth 字段为 0
- 允许 Task 工具注册,使用 max_nesting_depth 控制子代理嵌套层数
- SubAgentRuntimeConfig 新增 max_nesting_depth 配置项,默认值为 1
- TaskTool 新增 max_nesting_depth 字段和带深度限制的构造函数
- 任务执行时增加嵌套深度校验,超过最大深度返回错误提示,防止无限递归创建子代理
2026-06-17 14:43:55 +08:00
oudecheng
86d48a3ec0 feat: 实现自定义子代理加载功能
- 添加 SubagentCatalog::discover() 方法,支持从文件系统加载自定义子代理
- 支持 ~/.picobot/subagents/ 和 ./.picobot/subagents/ 两个目录
- 项目级定义可覆盖用户级定义
- 支持 YAML frontmatter + body 格式解析
- 修复 Windows 换行符兼容性问题
- 移除未使用的 read_only 字段
- 实现 TaskTool 动态 schema,子代理类型列表从运行时获取

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-25 11:56:44 +08:00
bee1a39a06 feat: add task management tool with subagent support
- Introduced `TaskConfig` struct to manage task-related configurations.
- Implemented `TaskTool` for creating and managing subagents for complex tasks.
- Added `TaskSession` and `TaskRepository` for handling task sessions and persistence.
- Created `DefaultSubAgentRuntime` to execute tasks with timeout and history support.
- Enhanced `ToolContext` to include `subagent_description` for better context tracking.
- Implemented error handling for task execution and session management.
- Updated `ToolRegistryFactory` to register task tools conditionally based on configuration.
- Added prompt builders for subagent tasks to improve interaction clarity.
2026-05-16 16:12:28 +08:00
9bf57c1132 feat: 移除任务管理相关功能,简化工具配置和依赖 2026-05-16 09:08:40 +08:00
020b7aa77a feat: 添加任务管理功能,支持创建和恢复子代理任务,优化任务执行和状态管理 2026-05-16 08:50:15 +08:00