67 Commits

Author SHA1 Message Date
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
oudecheng
5e5de7ce9f refactor: 移除 show_tool_results 开关,始终实时推送工具调用消息
简化工具消息推送逻辑,去掉条件判断,让所有工具消息(含结果)
直接通过 emit_live_tool_call_message 实时发送给用户。

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-28 18:52:40 +08:00
oudecheng
624d8e8943 feat: 添加 React Web UI 前端界面
- 使用 React 18 + TypeScript + Vite + Tailwind CSS 构建前端
- 实现 WebSocket 实时通信(useWebSocket hook)
- 添加聊天界面组件(MessageList, MessageBubble, MessageInput)
- 集成 Topic 管理(新建、列出、切换)
- 支持 Markdown 渲染(react-markdown + remark-gfm)
- 添加工具调用展示面板
- 实现深色科技主题(Tech Dark)
- 后端集成静态文件服务(tower-http)
- 添加 Makefile 和 build.sh 构建脚本
- 更新 .gitignore 忽略前端构建产物

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-26 17:43:15 +08:00
b571d7b7b3 feat: 添加图片上下文限制配置,支持最大图片数量和消息轮次限制 2026-05-24 18:06:22 +08:00
oudecheng
159c1bbb7a feat: 移除日志中的响应内容和模型信息,优化工具调用的日志记录 2026-05-21 17:20:26 +08:00
oudecheng
efc8af12eb feat: 添加参数提取工具函数,支持处理字符串化 JSON 数组,优化技能管理和会话发送功能 2026-05-21 17:00:22 +08:00
oudecheng
881c73c79f feat: 使用 platform 模块获取 Shell 信息,优化系统环境信息提示词生成 2026-05-20 15:55:23 +08:00
oudecheng
b364496601 feat: 添加生成系统环境信息提示词的功能,并在子代理提示词构建中集成 2026-05-20 15:13:06 +08:00
oudecheng
7540828397 Revert "feat: 添加流式聊天支持,更新相关依赖和接口以实现流式响应"
This reverts commit cb48ef09b22ef72798a15ff3485c8e21f77e59f4.
2026-05-20 09:20:26 +08:00
oudecheng
cb48ef09b2 feat: 添加流式聊天支持,更新相关依赖和接口以实现流式响应 2026-05-20 09:10:47 +08:00
oudecheng
90228a4d49 feat: 更新 GetCurrentSessionCommandHandler,添加系统提示词提供者支持并优化令牌估算逻辑 2026-05-19 18:29:32 +08:00
oudecheng
3c2650824c feat: 更新令牌估算逻辑,使用 JSON 序列化以匹配实际请求大小,并在当前话题处理器中添加令牌估算 2026-05-19 17:05:04 +08:00
6b5d45e3a5 feat: 添加探索类型最大执行时间配置,优化子代理任务执行逻辑 2026-05-16 17:05:03 +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
9d9fa1dc4b feat: 添加 memory_maintenance_timeout_secs 配置,优化内存维护超时设置 2026-05-12 22:11:34 +08:00
oudecheng
4473c9fc47 feat: 增强参数截断逻辑,确保在截断时遵循UTF-8字符边界,并添加相关单元测试 2026-05-12 17:44:39 +08:00
181740559b feat: 移除不再使用的记忆工具提示,更新默认代理配置中的记忆处理规则 2026-05-10 14:17:45 +08:00
42eb9f85d5 feat: 更新记忆工具使用说明,增加高价值场景记录要求;优化技能索引提示格式,支持 XML 标记
Co-authored-by: Copilot <copilot@github.com>
2026-05-06 17:22:01 +08:00
495c8cdc7e feat: 添加技能匹配摘要功能,优化技能提示信息,明确技能与工具的区别
Co-authored-by: Copilot <copilot@github.com>
2026-05-02 09:38:31 +08:00
531e72d24f feat: 添加图像处理预算和估算逻辑,优化消息内容构建,支持图像媒体引用
Co-authored-by: Copilot <copilot@github.com>
2026-05-01 21:22:07 +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
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
af7860f2fd feat: 重构消息模块,添加 ContentBlock 和 ToolCall 结构,优化消息处理逻辑
Co-authored-by: Copilot <copilot@github.com>
2026-04-28 14:04:59 +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
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
5b13748106 feat: 添加用户说默认消息的场景作为高价值信息写入规则 2026-04-27 17:06:14 +08:00
2bcdf0a539 feat: 更新记忆写入规则,优化高价值信息场景描述及注意事项 2026-04-27 15:57:05 +08:00
ed45ec54ed feat: 增强错误处理,添加format_error_chain函数以格式化错误链,优化日志记录 2026-04-27 09:35:10 +08:00
fc8a0aa6ae feat: 添加normalize_tool_arguments函数以解析字符串化的JSON参数,优化工具调用的参数处理 2026-04-27 09:29:50 +08:00
88e1bfd9f2 feat: 移除配置中的上下文摘要字符限制,优化摘要预算计算
Co-authored-by: Copilot <copilot@github.com>
2026-04-26 20:47:58 +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
3792472b83 feat: 调整工具结果和上下文摘要字符限制,优化性能 2026-04-25 16:09:19 +08:00
6b7822048a feat: 更新记忆检索文档,明确查询数组数量要求以提高搜索效果 2026-04-25 15:03:57 +08:00
95c53fa830 feat: 添加推理内容支持到聊天消息,增强消息处理能力 2026-04-24 17:42:19 +08:00
4b74fabb98 feat: 添加字符计数和文本截断功能,增强文本处理能力 2026-04-24 14:34:06 +08:00
e6f23858b8 feat(timezone): 添加时区支持,增强调度和日志功能 2026-04-23 23:50:08 +08:00
e24a081293 feat(scheduler): 添加上下文支持到调度器管理工具,增强目标处理能力 2026-04-23 23:26:41 +08:00
ab7a8ad924 feat(media): 添加媒体引用处理,增强用户内容的丰富性 2026-04-23 22:31:13 +08:00
7fefd40dca feat: 重构记忆工具提示和代理配置,增强用户指导和系统提示 2026-04-23 17:33:10 +08:00
f3f369b329 feat: add llm_timeout_secs to provider configuration and implement timeout handling
- Introduced llm_timeout_secs in ProviderConfig and LLMProviderConfig to specify timeout for LLM requests.
- Updated OpenAIProvider and AnthropicProvider to utilize the timeout setting when creating HTTP clients.
- Enhanced error handling for API responses to include timeout information.
- Modified SessionManager to support agent-specific provider configurations, allowing for more flexible agent management.
- Added tests to verify the correct behavior of timeout settings and agent task validation.
2026-04-23 09:23:15 +08:00
73840c608c feat(memory): 更新长期记忆工具提示,增强用户使用指导和检索流程
feat(gateway): 修改 WebSocket 处理逻辑以支持会话 ID 的字符串处理
2026-04-22 23:40:11 +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
65abf017a1 feat(gateway): 添加 show_tool_results 配置以控制工具结果显示
feat(memory): 更新 MemoryManageTool 和 MemorySearchTool 描述,优化参数处理
2026-04-22 15:27:53 +08:00
0331774466 feat: 更新长期记忆工具提示,增强用户使用指导 2026-04-22 15:06:11 +08:00
71a8033d15 feat(memory): 添加 MemorySearchTool 以支持长期用户记忆的搜索和读取功能 2026-04-22 14:52:16 +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