20 Commits

Author SHA1 Message Date
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
a2c7981d6d feat: 添加 fresh_session 选项以支持清理历史记录 2026-06-02 23:31:05 +08:00
oudecheng
ea6fabe41d feat: 添加持久化消息处理程序,增强定时任务消息的持久化能力 2026-06-02 18:42:50 +08:00
7d9355fd78 feat: WebSocket 媒体文件处理优化
- 后端 ws.rs: 处理前端上传的 base64 内容,保存到本地文件并更新路径
- 后端 ws.rs: 历史消息加载时从文件读取内容填充 base64,过滤 media_refs_json
- 前端 App.tsx: 传递 attachments 给 handleMessage 实现实时显示
- 前端 useChat.ts: handleMessage 支持 attachments 参数
- 前端 MessageInput.tsx: 支持剪贴板粘贴文件/图片
- 前端 MessageInput.tsx: 修复拖拽文件时闪烁问题
- 测试 test_request_format.rs: 补充缺失的 attachments 字段
2026-05-30 10:22:30 +08:00
oudecheng
06756a4816 fix: 修复消息持久化缺失 topic 关联和 assistant 文本丢失
- PersistingEmittedMessageHandler 新增 topic_id 参数,使用 append_message_with_topic 替代 append_message
- agent_loop 的所有退出路径中为最终 assistant 文本添加 emit_live_tool_call_message
- 更新 finalize_result filter,live_emitter 存在时抑制所有消息的 post-loop 广播

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 18:09:00 +08:00
oudecheng
d0051baa07 refactor: 消息持久化从批量改为实时逐条,通过装饰器模式实现
- 新增 PersistingEmittedMessageHandler 装饰器,在 emitter 广播前逐条落库
- processor 和 task/runtime 使用装饰器包裹 emitter,替代 post-loop 批量写入
- 移除 session_history 中的批量 DB 写入,仅保留内存历史更新
- execution 中跳过已由 live emitter 实时广播的工具消息,避免重复
- 前端支持运行中 task 工具卡片"查看实时进度"跳转子智能体视图

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-29 16:47:57 +08:00
b6f2de053d refactor: 移除会话重置逻辑中的 reset_cutoff_seq 字段,优化会话管理和历史压缩逻辑 2026-05-23 18:38:34 +08:00
oudecheng
c817b1dde1 feat: 优化会话消息处理逻辑,支持在话题切换时正确保存消息并更新内存历史 2026-05-21 18:04:11 +08:00
oudecheng
8830027cbc feat: 添加原始话题 ID 支持,优化消息保存逻辑以处理用户话题切换 2026-05-20 12:05:58 +08:00
oudecheng
025c0b5d7f feat: 添加 session_id 支持到 OutboundMessage,优化会话管理 2026-05-15 10:00:17 +08:00
b77fc93d71 Refactor command handling and input adapters
- Removed the `format_session_list` function and related session handling from the client module.
- Simplified command output in the client by removing session-related commands.
- Introduced `ChannelInputAdapter` for parsing channel commands like `/new` and `/save`.
- Updated WebSocket handling to process commands via the new command system.
- Removed deprecated in-chat command handling from the gateway.
- Adjusted tests to reflect changes in command serialization and session handling.
- Enhanced session cleanup and job scheduling in the configuration module.
2026-05-14 22:23:02 +08:00
oudecheng
e712fd7645 feat: 修改提示词注入逻辑,确保每次处理用户消息时动态注入系统提示词;优化消息历史记录获取顺序 2026-05-14 11:28:53 +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
e5e2b37246 feat: 重构会话管理逻辑,添加多个服务以优化会话和任务调度
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 14:43:46 +08:00
008aba91ac feat: 重构调度器以使用 AgentTaskExecutor 和 SchedulerMaintenanceService
- 更新调度器,将 SessionManager 替换为 AgentTaskExecutor 和 SchedulerMaintenanceService。
- 修改作业执行逻辑,使用新服务处理代理任务和内部事件。
- 添加新的 CliChannel 以处理 CLI 连接,并包括适当的注册和注销逻辑。
- 引入 AgentTaskExecutor 和 SchedulerMaintenanceService,用于管理代理任务和会话维护。
- 实现聊天命令处理,用于重置会话上下文。
- 添加后台历史压缩功能,以优化会话存储。
- 创建实用函数,用于准备通过 WebSocket 通信的出站消息。
- 为新功能添加测试,并确保现有测试通过。

Co-authored-by: Copilot <copilot@github.com>
2026-04-28 12:55:30 +08:00
14476bb101 feat: 添加 context_window_tokens 配置,调整模型温度并重构消息执行逻辑 2026-04-28 11:45:36 +08:00
fa3354db9c feat: add context_window_tokens to model configuration and update related logic
- Introduced context_window_tokens in ModelConfig and LLMProviderConfig structs.
- Updated context window estimation logic in ContextCompressor to use context_window_tokens.
- Modified tests to accommodate new context_window_tokens field.
- Refactored memory maintenance logic into a new memory_maintenance.rs file for better organization.
- Ensured backward compatibility by providing default values where necessary.

Co-authored-by: Copilot <copilot@github.com>
2026-04-28 11:29:06 +08:00
b2c8d76820 feat: 添加最终结果处理和调度压缩功能,重构会话管理逻辑以优化代码结构 2026-04-28 10:58:01 +08:00
33f5a4cbd2 feat: 添加执行服务和提示管理功能,重构相关模块以优化代码结构 2026-04-28 10:51:54 +08:00