oudecheng
cda14360af
chore: 建立工程化基线(rustfmt + clippy + CI + eslint + prettier)
...
配置:
- rustfmt.toml: 固化 max_width=100 / 4 空格缩进,cargo fmt 全量格式化
- Cargo.toml: 配置 [lints.rust] 与 [lints.clippy] 渐进式规则
- .github/workflows/ci.yml: Rust(fmt+clippy+test) + 前端(eslint+tsc+test) 双平台 CI
- Makefile: 新增 check/fmt/fix 目标,clippy 对齐 --all-targets --all-features
- web: eslint flat config + prettier 配置 + package.json 脚本与依赖
- src/main.rs: loop→while 修复 clippy::never_loop
对抗性审查发现并修复:
- eslint 缺 caughtErrorsIgnorePattern 导致 catch(_) 误报为 error
- 前端 lint 未接入 CI,现已补上 Lint 步骤
- Makefile 与 CI 的 clippy flags 不一致,已对齐
2026-08-03 23:24:02 +08:00
oudecheng
46a1ca6853
refactor: 修复 3 项 P1 技术债(硬编码 URL / any 类型 / dead_code)
...
P1-1: 硬编码 wechat URL 抽常量统一两处
- config/mod.rs: 定义 pub const WECHAT_DEFAULT_BASE_URL
- cli/init.rs: import 并引用常量,消除字面量重复
- 消除两处不一致风险(default_wechat_base_url 与 init 向导)
P1-2: ConfigPage any 类型定义具体类型(8 处)
- types.ts: 新增 FeishuChannelConfig/WechatChannelConfig/ChannelConfig/
SchedulerJobConfig 类型;jobs?: any[] → SchedulerJobConfig[];
channels: Record<string, any> → Record<string, ChannelConfig>
- api/config.ts: 新增 RestartResponse 类型,data: any → RestartResponse
- ConfigPage.tsx: catch (e: any) ×2 → catch (e: unknown) + 类型守卫;
as any → as SchedulerConfig['misfire_policy'];
Record<string, any> → Partial<ChannelConfig>;(ch: any) → (ch: ChannelConfig)
P1-3: dead_code 18 处逐一审查清理
- 删除 10 处未使用函数/struct(YAGNI 原则):
context_compressor.rs (into_messages, is_tool_round)
agent_loop.rs (EmptySkillProvider struct + impl)
memory_maintenance.rs (run_for_scope)
session.rs (try_start/finish_background_compaction)
session_history.rs (try_start/finish_background_compaction)
tool_registry_factory.rs (shell_session_manager)
task/runtime.rs (effective_allowed_tools)
- 保留 8 处 serde 反序列化字段(删除会破坏 JSON 反序列化):
feishu.rs/openai.rs/anthropic.rs/skills/mod.rs/task/runtime.rs
2026-07-08 14:51:42 +08:00
oudecheng
4da7b5f505
fix: TodoWriteTool merge 模式内存为空时从 DB 回填,防止丢失旧项
...
todo_write.rs: 内存状态为空时从 repository.list_todos 回填,保证 merge 模式不丢失旧项(进程重启后内存清空场景)。新增 MockTodoRepository 和回填测试。
tool_registry_factory.rs: TodoWriteTool::new 传入 todo_repository。
2026-07-07 14:13:56 +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
97c0e46348
feat(tests): 增加工具调用序列清理的单元测试,确保孤立工具结果的正确处理
2026-06-16 16:52:00 +08:00
oudecheng
7626ba2d2f
feat(gateway): 添加待办事项读取功能
...
- 引入 TodoReadTool 工具支持读取当前对话的待办事项列表
- 实现从内存或SQLite数据库读取待办事项的功能
- 添加内存回填机制确保数据一致性
- 在ToolRegistryFactory中注册新的待办事项读取工具
- 更新会话初始化逻辑以传递待办事项存储依赖
- 添加完整的单元测试验证各种读取场景
2026-06-15 15:33:43 +08:00
02172b6065
feat(shell): 实现交互式Shell会话管理
...
- 新增ShellSessionManager管理交互式shell会话,支持进程保持和交互输入
- BashTool集成会话管理,支持session_id和stdin_input参数实现输入回复
- 修改BashTool执行逻辑,检测进程等待输入状态并保存会话状态
- Windows平台新增底层进程等待输入检测实现,辅助判断Shell交互状态
- 工具注册工厂注入ShellSessionManager,保证安全复用会话管理实例
- 增加默认agent prompt中Shell交互终端说明,提示交互流程及输入格式
- 交互式命令输出增加标识和提示,区分正常与等待输入状态
- 实现会话超时自动清理和优雅关闭接口,避免资源泄露
- 单元测试中统一使用BashTool默认构造,适配会话管理新增功能
2026-06-13 09:06:45 +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
644f5f9132
feat: 子代理继承主代理的 MCP 工具
...
- 为 McpToolWrapper 添加 Clone trait,支持工具实例复用
- 修改 build_subagent_tools 方法,支持传入 MCP 工具列表
- 调整 runtime 构建顺序:先等待 MCP 连接,再将 MCP 工具传递给子代理
子代理现在可以自动使用主代理配置的 MCP 工具(如 filesystem、fetch 等)。
2026-05-26 11:53:40 +08:00
cbb384a4e6
feat: 添加 MCP (Model Context Protocol) 支持,包含客户端管理器和工具适配器
2026-05-23 22:52:36 +08:00
oudecheng
2724334d52
feat: 移除 SkillListTool,简化技能管理工具
2026-05-22 14:01:22 +08:00
oudecheng
8f82009c32
feat: 重命名工具名称,简化工具调用接口
2026-05-19 15:18:04 +08:00
831832664d
feat: 重构会话管理逻辑,添加获取当前话题的方法,简化命令处理中的会话获取逻辑
2026-05-16 20:19:49 +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
33e6b78267
feat: 添加工具配置示例,支持工具启用/禁用功能;更新调度器管理工具描述以支持标准 cron 语法
2026-05-10 13:57:47 +08:00
260266b90f
feat: 添加会话消息发送工具,支持文本和附件的发送,优化消息发送逻辑
2026-05-02 09:15:36 +08:00
716d92a618
feat: 引入 AgentRuntimeConfig,重构相关模块以支持运行时配置
...
Co-authored-by: Copilot <copilot@github.com>
2026-04-30 22:34:22 +08:00
90e44950cb
feat: 重构技能事件处理逻辑,移除 SkillEventSink,添加 SkillActivateTool 模块以优化技能激活流程
...
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 15:31:56 +08:00
c65921b5e8
feat: 添加 AgentFactory 和 PromptInjector,重构工具注册逻辑以优化会话管理
2026-04-28 13:06:00 +08:00