94 Commits

Author SHA1 Message Date
oudecheng
f4758f8513 feat: 添加平台抽象层,支持跨平台兼容性;更新多个模块以使用临时目录和平台特定路径 2026-05-09 16:59:58 +08:00
oudecheng
e0a7f67dab feat: 添加对 user_openclaw 技能源的支持,更新相关描述和逻辑 2026-05-09 14:38:06 +08:00
oudecheng
ba0e1c2473 feat: 添加对 project_openclaw 技能源的支持,更新相关描述和逻辑 2026-05-09 14:31:38 +08:00
69364e484b feat: 添加技能禁用功能,支持批量禁用技能并更新运行时状态 2026-05-06 15:30:59 +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
260266b90f feat: 添加会话消息发送工具,支持文本和附件的发送,优化消息发送逻辑 2026-05-02 09:15:36 +08:00
fc5b2a359f feat: 优化响应截断逻辑,支持多字节字符边界处理,并添加相关单元测试 2026-05-01 16:07:20 +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
8f27bd2735 feat: 重构工具和协议模块,添加工具注册和会话管理逻辑,优化消息处理 2026-04-28 14:16:30 +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
bca86abe67 feat: 扩展技能源支持,添加用户代理和项目代理,优化技能管理工具描述 2026-04-28 09:32:37 +08:00
8c17af1209 feat: 添加silent_agent_task类型的调度任务,支持后台执行并优化通知机制 2026-04-27 15:38:43 +08:00
37dc3385bb feat: 添加TimeTool以获取当前时间和计算相对时间,支持时区覆盖 2026-04-27 09:54:38 +08:00
60cc8e507c feat: 添加定时任务执行系统提示,优化agent_task作业的提示描述,避免重复调度时间 2026-04-26 23:31:21 +08:00
c83d697f93 feat: 增强OpenAIProvider以支持JSON工具参数,优化调度管理工具的参数验证和错误处理 2026-04-26 23:05:34 +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
e24a081293 feat(scheduler): 添加上下文支持到调度器管理工具,增强目标处理能力 2026-04-23 23:26:41 +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
1ffdcab585 feat(scheduler): 添加 agent_task 类型支持,扩展任务调度功能 2026-04-23 08:45:32 +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
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
c58644e7bc feat(bash): 优化输出截断逻辑,确保处理UTF-8字符边界 2026-04-22 12:04:43 +08:00
9cda2ab8d5 feat(memory_manage): 更新记忆管理工具描述,增强搜索关键词的双语支持和内容匹配说明 2026-04-22 11:37:15 +08:00
bc24a28275 feat(memory_manage): 添加搜索功能以查找用户记忆,优化参数描述 2026-04-22 08:45:20 +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
c971bc3639 feat: 添加上下文压缩功能,优化消息历史管理和工具调用日志记录 2026-04-12 18:38:38 +08:00
fb0a9e06aa feat(agent): add loop detection and result truncation for tool calls 2026-04-12 13:18:16 +08:00
394b5fdd6a feat:1、agentloop支持多轮工具调用
2、并发工具调用
3、可观测性改进。
2026-04-12 11:02:48 +08:00
862eb1115a Revert "feat(agent): add parallel tool execution with concurrency-safe batching"
This reverts commit 0c0d0c14436a230ca34c0cd9647c8fc14f62d7cc.
2026-04-12 09:54:38 +08:00
0c0d0c1443 feat(agent): add parallel tool execution with concurrency-safe batching
Implement parallel tool execution in AgentLoop, following the approach
used in Nanobot (_partition_tool_batches) and Zeroclaw (parallel_tools).

Key changes:
- partition_tool_batches(): group tool calls into batches based on
  concurrency_safe flag. Safe tools run in parallel via join_all;
  exclusive tools (e.g. bash) run in their own sequential batch.
- execute_tools(): now uses batching instead of flat sequential loop.
- CalculatorTool: add read_only() -> true so it participates in
  parallel batches (it has no side effects, so concurrency_safe = true).

4 unit tests added covering: mixed safe/exclusive, all-safe single
batch, all-exclusive separate batches, unknown tool defaults.
2026-04-08 12:04:03 +08:00
8936e70a12 feat(tools): add web_fetch tool for HTML content extraction
- Fetch URL and extract readable text
- HTML to plain text conversion
- Removes scripts, styles, and HTML tags
- Decodes HTML entities
- JSON pretty printing
- SSRF protection
- Includes 6 unit tests
2026-04-07 23:52:06 +08:00
1581732ef9 feat(tools): add http_request tool with security features
- HTTP client with GET/POST/PUT/DELETE/PATCH support
- Domain allowlist for security
- SSRF protection (blocks private IPs, localhost)
- Response size limit and truncation
- Timeout control
- Includes 8 unit tests
2026-04-07 23:49:15 +08:00
68e3663c2f feat(tools): add bash tool with safety guards
- Execute shell commands with timeout
- Safety guards block dangerous commands (rm -rf, fork bombs)
- Output truncation for large outputs
- Working directory support
- Includes 7 unit tests
2026-04-07 23:47:44 +08:00
f3187ceddd feat(tools): add file_edit tool with fuzzy matching
- Edit file by replacing old_text with new_text
- Supports multiline edits
- Fuzzy line-based matching for minor differences
- replace_all option for batch replacement
- Includes 5 unit tests
2026-04-07 23:46:34 +08:00
16b052bd21 feat(tools): add file_write tool with directory creation
- Write content to file, creating parent directories if needed
- Overwrites existing files
- Includes 5 unit tests
2026-04-07 23:44:45 +08:00
a9e7aabed4 feat(tools): add file_read tool with pagination support
- Read file contents with offset/limit pagination
- Returns numbered lines for easy reference
- Handles binary files as base64 encoded
- Supports directory restriction for security
- Includes 4 unit tests
2026-04-07 23:43:47 +08:00
d5b6cd24fc feat(tools): add SchemaCleanr for cross-provider schema normalization
- Add SchemaCleanr with CleaningStrategy enum (Gemini, Anthropic, OpenAI, Conservative)
- Support cleaning JSON schemas for different LLM provider compatibility
- Add $ref resolution, anyOf/oneOf flattening, const-to-enum conversion
- Add read_only, concurrency_safe, exclusive methods to Tool trait
- Add comprehensive unit tests for all schema cleaning features
2026-04-07 23:41:20 +08:00
9834bd75cf feat: add calculator tool and integrate with agent loop
- Introduced a new CalculatorTool for performing various arithmetic and statistical calculations.
- Enhanced the AgentLoop to support tool execution, including handling tool calls in the process flow.
- Updated ChatMessage structure to include optional fields for tool call identification and names.
- Modified the Session and SessionManager to manage tool registrations and pass them to agents.
- Updated the OpenAIProvider to serialize tool-related message fields.
- Added a ToolRegistry for managing multiple tools and their definitions.
- Implemented tests for the CalculatorTool to ensure functionality and correctness.
2026-04-06 23:43:45 +08:00