48 Commits

Author SHA1 Message Date
oudecheng
edc1a50d1c feat(todos): 修改 todos 表结构,迁移至复合主键并添加索引 2026-06-16 16:17:12 +08:00
oudecheng
6f8c4a7ce8 feat: 更新 load_messages_for_topic 方法,支持按 session_id 过滤消息 2026-06-12 19:05:06 +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
c0d4f65de4 feat: 更新数据库连接管理,使用连接池优化会话存储,添加新的错误处理 2026-06-07 21:35:47 +08:00
cf1152571d feat: 实现内存记录的去重和统一 scope_key 为 "default" 2026-06-06 15:07:06 +08:00
abb2d596f4 feat: 统一记忆 scope_key 为 "default",简化上下文依赖 2026-06-06 14:52:54 +08:00
oudecheng
2f529e96d0 feat: 添加滚动控制功能,支持回到顶部和回到底部的按钮 2026-06-04 16:00:43 +08:00
oudecheng
025c355c7d feat: 在消息查询中添加工具执行时长字段,增强消息记录功能 2026-06-02 17:27:29 +08:00
oudecheng
590ea9abb0 feat: 添加工具执行时长字段到消息存储,增强消息记录功能 2026-06-02 17:17:06 +08:00
oudecheng
4d6d989247 feat: 添加工具执行时长字段,增强消息处理功能 2026-06-02 16:52:47 +08:00
1288ba268f feat: 限定记忆命名空间为7种分类
- 新增 ALLOWED_MEMORY_NAMESPACES 常量定义允许的命名空间
- 添加 namespace 验证函数 is_valid_namespace()
- memory_manage 工具 schema 使用 enum 限制 namespace
- memory_search 工具 schema 使用 enum 提示可用 namespace
- 更新系统提示词添加命名空间分类说明
- 更新记忆维护提示词添加命名空间分类说明
- 修复测试中使用旧 namespace 的问题

命名空间分类:
- user: 用户记忆
- semantic: 语义记忆
- episodic: 情景记忆
- skill: 技能记忆
- environment: 环境记忆
- reflection: 反思记忆
- other: 其他记忆
2026-05-30 13:06:55 +08:00
oudecheng
3b0b4c1f2e refactor: 消息持久化改为批量单事务插入
- 新增 append_messages_batch 方法,所有消息在一个事务内插入
- session_history 移除逐条 append_persisted_message,统一走批量路径
- 子智能体消息保存从 for 循环改为批量调用

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 13:02:15 +08:00
oudecheng
4cb26b5b67 feat: 子智能体任务消息查看,实时广播工具调用事件
- 新增 LoadTaskMessages 命令,加载子智能体任务的历史消息
- SubAgentEmitter 通过 MessageBus 实时广播子智能体工具调用
- 前端新增子智能体视图,支持导航进入/退出子智能体会话
- 外部渠道过滤子智能体事件,避免推送到飞书/微信
- ToolCall/ToolResult 新增 subagent_task_id 字段

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 11:15:38 +08:00
oudecheng
598d425c28 feat: 话题添加描述字段,工具消息按 tool_call_id 合并展示
- TopicSummary 新增 description 字段,侧边栏优先显示描述
- ToolPanel 使用 toolCallId 将 tool_call 和 tool_result 配对合并展示
- 保存消息时同步更新 topics 表的 message_count 和 last_active_at
- ChatMessage 新增 toolCallId 字段

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 14:30:21 +08:00
0732b31e6b feat: 添加主题描述生成和更新功能,优化会话信息展示 2026-05-24 08:32:34 +08:00
b6f2de053d refactor: 移除会话重置逻辑中的 reset_cutoff_seq 字段,优化会话管理和历史压缩逻辑 2026-05-23 18:38:34 +08:00
oudecheng
cc3e890ccd feat: 添加 list_skill_events 方法到 SkillEventRepository,支持可选 session_id 参数 2026-05-22 10:47:55 +08:00
oudecheng
70b35d2cc1 feat: 更新聊天历史加载逻辑,支持按话题加载历史记录并避免借用冲突 2026-05-22 10:47:25 +08:00
oudecheng
8d530dcd6b feat: 添加确保会话存在的功能,优化子智能体会话管理 2026-05-20 17:21:14 +08:00
oudecheng
8f82009c32 feat: 重命名工具名称,简化工具调用接口 2026-05-19 15:18:04 +08:00
4eb6193d0c feat: 添加获取话题消息数量的方法,优化话题列表和切换话题的反馈信息 2026-05-16 22:03:32 +08:00
6a902b9ff9 feat: 添加带话题的消息追加功能,支持在会话中关联当前话题 ID 2026-05-16 20:32:00 +08:00
oudecheng
2e13f6932c feat: Enhance session management with topic support
- Added topic management capabilities, allowing users to create, switch, and query topics within sessions.
- Updated command structure to include new commands: SwitchSession and GetCurrentSession.
- Introduced TopicRecord for managing topic data in the storage layer.
- Modified session handlers to accommodate topic operations, including listing and loading topics.
- Enhanced database schema to support topics, including new tables and relationships.
- Updated input adapters to recognize new commands and handle topic-related actions.
- Improved logging for session and topic operations to aid in debugging and monitoring.
2026-05-15 15:01:58 +08:00
5eb9a26843 feat: 添加会话查询命令处理器,支持列出和加载会话功能 2026-05-14 23:27:23 +08:00
oudecheng
7238bd20d8 feat: 添加恢复中断调度任务的功能,支持从上次会话中恢复运行中的任务 2026-05-12 16:18:45 +08:00
597881f72e feat: Implement WeChatBot SDK with error handling and message protocol
- Add WeChatBotError enum for error handling with various error types.
- Create a Result type alias for easier error management.
- Implement ILinkClient for low-level API interactions including QR code generation, message sending, and updates retrieval.
- Define message types and structures for handling incoming messages and media content.
- Add tests for error handling and message parsing to ensure reliability.

Co-authored-by: Copilot <copilot@github.com>
2026-05-06 14:18:47 +08:00
3f5ed6e4e4 feat: 移除不必要的 list_memory_scope_keys_updated_since 方法及其测试,优化代码结构 2026-05-05 19:53:55 +08:00
891830779f feat: 重构存储逻辑,使用 ConversationRepository 和 PromptInjectionRepository 替代 SessionStore,优化会话和提示注入管理
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 15:55:27 +08:00
f48b132bb9 feat: 重构调度器存储逻辑,使用 SchedulerJobRepository 替代 SessionStore,添加更新调度作业运行时的方法 2026-04-28 15:40:50 +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
8f27bd2735 feat: 重构工具和协议模块,添加工具注册和会话管理逻辑,优化消息处理 2026-04-28 14:16:30 +08:00
af7860f2fd feat: 重构消息模块,添加 ContentBlock 和 ToolCall 结构,优化消息处理逻辑
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 14:04:59 +08:00
73dab09bfe Refactor code for improved readability and consistency
- Adjusted formatting and indentation in various files for better clarity.
- Consolidated multi-line statements into single lines where appropriate.
- Enhanced error handling messages for better debugging.
- Added a new InboundProcessor struct to handle inbound messages more effectively.
- Updated test cases to ensure they align with the new code structure.
2026-04-28 10:33:31 +08:00
4fb102644e feat: 更新调度配置以每4小时执行内存维护,并添加根据更新时间过滤内存范围的功能 2026-04-27 13:05:55 +08:00
3045a6b596 feat: Enhance ChatMessage with system context and background compaction
- Added `system_context` field to `ChatMessage` for better message context handling.
- Introduced constants for system context prompts in `message.rs`.
- Updated `Session` to manage background history compaction, including methods to start and finish compaction.
- Implemented logic to schedule background compaction after message processing in `SessionManager`.
- Enhanced database schema to support new `system_context` field in messages.
- Added functionality to compact active history, preserving system messages and summaries.
- Updated tests to validate new compaction logic and ensure message integrity.
- Removed unused functions and cleaned up code in various modules for better maintainability.

Co-authored-by: Copilot <copilot@github.com>
2026-04-26 09:31:13 +08:00
95c53fa830 feat: 添加推理内容支持到聊天消息,增强消息处理能力 2026-04-24 17:42:19 +08:00
3d241544c5 feat(memory): 添加内置记忆维护作业,增强调度功能并支持有效作业合并 2026-04-23 14:16:22 +08:00
a3ae8acde5 feat: add DB-backed scheduler for heartbeat, delayed jobs, interval jobs, and cron jobs
- Add scheduler module with SQLite persistence
- Support schedule types: delay, interval, at, cron
- Support job kinds: internal_event, outbound_message
- Add scheduler_manage tool for runtime management
- Add session_cleanup internal event for expired sessions
- Update memory tool usage prompt for better context awareness
- Add chrono and cron dependencies
2026-04-22 20:32:18 +08:00
038b5eccc6 feat: Enhance tool execution handling with pending user action state
- Introduced ToolMessageState enum to represent tool execution states (Completed, PendingUserAction).
- Updated ChatMessage struct to include tool_state for tracking tool execution status.
- Modified AgentLoop to handle tool results and pending actions, providing appropriate responses to users.
- Enhanced BashTool to detect when commands require user interaction, returning a pending state with hints.
- Updated WebSocket protocol to support tool pending messages, allowing clients to handle pending actions effectively.
- Refactored related tests to ensure proper functionality of new pending state handling.
2026-04-22 14:49:50 +08:00
9cda2ab8d5 feat(memory_manage): 更新记忆管理工具描述,增强搜索关键词的双语支持和内容匹配说明 2026-04-22 11:37:15 +08:00
9d15d50b09 feat(session): 更新聊天加载逻辑,确保初始代理提示并添加活跃用户消息计数功能 2026-04-22 10:09:39 +08:00
0dfa615ca9 feat(agent_profile): 实现代理配置文件的注入与周期性重注入机制 2026-04-22 09:45:19 +08:00
d35e89a44c # 2026-04-22 06:57:22 +08:00
0c724e37bb feat: add runtime skill management and persistence 2026-04-21 18:21:14 +08:00
393d980742 feat(session): 添加逻辑重置功能,优化会话历史管理 2026-04-20 22:35:13 +08:00
eb0f6c0bc7 feat(storage): 移除工具调用 JSON 列的数据库检查,优化会话存储逻辑 2026-04-18 14:40:12 +08:00
ef601107ac feat: 添加工具调用支持,优化消息处理和持久化 2026-04-18 14:17:23 +08:00
8bb32fa066 feat: enhance WebSocket session management and storage
- Added SessionSummary struct for session metadata.
- Updated ws_handler to create and manage CLI sessions more robustly.
- Implemented session creation, loading, renaming, archiving, and deletion via WebSocket messages.
- Introduced SessionStore for persistent session storage using SQLite.
- Enhanced error handling and logging for session operations.
- Updated protocol definitions for new session-related WebSocket messages.
- Refactored tests to cover new session functionalities and ensure proper serialization.
2026-04-18 13:09:14 +08:00