oudecheng
bde55cbf14
feat: 重构工具提示提供者,整合工具使用说明;删除冗余的 TodoPromptProvider
2026-07-07 10:03:16 +08:00
oudecheng
4329cfbbe9
feat: 统一路径显示格式,确保跨平台兼容性;重构系统提示词提供者构建逻辑
2026-07-07 09:19:58 +08:00
oudecheng
9d7c1f2e52
feat: 集成专家提示词到网关配置、依赖注入与HTTP API
...
- config: 新增 ExpertsConfig,默认 sources=[user,project], enabled=true
- AgentFactory: 新增 experts 字段,providers 顺序为 Agent→Skill→Expert→Subagent→Todo
- GatewayState: 持有 Arc<ExpertRuntime>,from_config 中初始化
- runtime: build_session_manager_with_sender 接收 experts 参数
- 路由: 注册 7 个专家 API (list/toggle/create/update/delete/selected/select)
- http: 实现 7 个处理器,支持专家 CRUD 与 session 级选择
- session/cli: 测试便利构造器与 empty_config/build_config 补齐 experts 字段
2026-07-06 18:07:33 +08:00
oudecheng
8d30ccd020
feat: 新增子代理管理API,支持获取子代理列表和切换子代理状态
2026-07-06 14:41:30 +08:00
oudecheng
5ceafb1fd7
feat: 添加配置应用诊断日志,便于排查 AgentFactory 实例与工具列表
2026-07-03 16:33:01 +08:00
oudecheng
606fcbcd29
feat(agent): 注入并传递 tool_call_id 实现任务与工具调用精准关联
...
- 在 agent_loop 执行上下文中注入 tool_call_id,确保执行时传递该字段
- 在 agent_factory、ws、todo_read、todo_write 等多处构造对象时添加 tool_call_id 字段初始化
- 扩展协议定义及序列化,支持 tool_call_id 字段传递
- 在工具调用任务运行时传递 tool_call_id,便于事件追踪和层级关联
- 在前端 useChat hook 增加 tool_call_id 关联逻辑,实现 task_started 事件精准匹配和跳转
- 增加 pendingTaskNavs 缓存处理,解决 task_started 事件先于 tool_call 到达的顺序问题
- 调整消息渲染逻辑,根据 tool_call_id 进行优先匹配,提升用户交互体验
2026-06-22 10:22:36 +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
e506ffd539
feat(agent): 支持子孙智能体的父任务链路传递
...
- 在 agent_factory 和子代理相关结构体中新增 parent_task_id 字段
- 协议层序列化、反序列化及 WebSocket 适配器支持 parent_task_id 信息传递
- todo_read 与 todo_write 工具添加 parent_task_id 以保持任务层级一致
- 在 DefaultSubAgentRuntime 中实现从 session_id 提取 parent_task_id 的逻辑
- 子智能体创建孙智能体时,正确设置并传递 parent_task_id 元数据
- 前端 useChat 钩子过滤孙智能体的 TaskStarted 事件,避免视图串扰
2026-06-18 11:30:47 +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
eef0d24dcd
fix: topic_id 穿透到 ToolContext,统一 todo scope_key 计算
...
- AgentBuildRequest 加 topic_id 字段
- Session.create_agent 传入 current_topic
- ToolContext.topic_id 不再硬编码 None
- 删除已废弃的 intercept_todo_write_results
- 工具/emitter/handler 三处 scope_key 计算全部统一
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 17:36:10 +08:00
oudecheng
881fcace47
feat: 添加 todo_write 工具,支持全量替换和增量合并两种模式
...
- Tool: 纯内存实现 (Arc<RwLock<HashMap>>),零 DB 依赖,解耦持久化
- 状态机: pending → in_progress → completed/cancelled,单 in_progress 约束
- merge=false: 全量替换模式(默认)
- merge=true: 增量更新模式,只传变更的项,其余保留
- 隔离: scope_key = topic_id.unwrap_or(session_id),topic 和子代理隔离
- 持久化: TodoRepository trait + SessionStore SQLite 实现,在 Session 拦截器层完成
- 前端推送: WsOutbound::TodoList 事件
- Prompt: TodoPromptProvider 中文指令,子代理模板也包含
- 测试: 16 个单元测试,全部通过
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-12 14:19:07 +08:00
oudecheng
1b571e943f
feat: 添加停止当前执行的 Agent 功能,支持通过 /stop 命令取消执行
2026-06-03 16:49:29 +08:00
oudecheng
1c6ee160e5
feat: 添加父话题 ID 支持,优化子智能体任务管理和会话关联
2026-05-20 18:11:16 +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
oudecheng
1c1efcabf4
feat: 移除冗余的 provider_config 字段,优化 AgentFactory 和 Session 的构造逻辑
2026-05-13 15:41:52 +08:00
oudecheng
a06fceaf0c
feat: 添加系统提示词提供者,支持动态注入和组合多个提示词源
2026-05-13 14:55:50 +08:00
oudecheng
cadc5e5577
feat: 支持分离 session_chat_id 和 notification_chat_id,优化任务执行逻辑
2026-05-13 09:39:05 +08:00
90e44950cb
feat: 重构技能事件处理逻辑,移除 SkillEventSink,添加 SkillActivateTool 模块以优化技能激活流程
...
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 15:31:56 +08:00
396504dffb
Refactor agent and storage components to introduce SkillProvider and repository patterns
...
- Introduced `SkillProvider` trait to abstract skill-related functionalities.
- Replaced `SkillRuntime` with `EmptySkillProvider` in `AgentLoop` for default behavior.
- Updated `AgentFactory` to accept `SkillProvider` instead of `SkillRuntime`.
- Created `SessionHistory` struct to manage chat histories and interactions.
- Added `MemoryRepository`, `SchedulerJobRepository`, and `SkillEventRepository` traits for better storage abstraction.
- Refactored tools to use new repository traits for memory and scheduler management.
- Cleaned up session management logic by consolidating chat history handling into `SessionHistory`.
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 15:12:45 +08:00
c547b88a12
feat: 添加持久化技能事件处理逻辑,重构技能事件记录机制
...
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 14:49:31 +08:00
c65921b5e8
feat: 添加 AgentFactory 和 PromptInjector,重构工具注册逻辑以优化会话管理
2026-04-28 13:06:00 +08:00