29 Commits

Author SHA1 Message Date
bafa7a606c fix: update database filename and improve session management in chat manager 2026-05-10 15:51:03 +08:00
11a8e93b77 feat(chat-manager): enhance message retrieval with pagination and time range filtering 2026-05-10 15:12:30 +08:00
25d37bcdc1 feat(system-prompt): add history section prompting agent to use timeline_recall 2026-05-10 14:46:20 +08:00
cb1140e9be refactor(memory): Timeline 按 session 隔离,拆分知识/摘要检索工具
- storage/memory: search_memories 和 search_memories_by_time 增加 session_id 过滤参数
- memory/manager: recall/recall_by_time 透传 session_id
- tools: MemoryStoreTool/MemoryRecallTool 锁定 Knowledge 类别,移除 category 参数
- tools: 新增 TimelineRecallTool 用于检索会话摘要,支持可选 session_id 过滤
- tools: 输出格式化增加 session 信息显示
- tests: 新增 test_session_id_filter 验证会话级过滤
2026-05-10 13:35:21 +08:00
81e9f1e7db clippy --fix: 合并嵌套if、简化map_or、移除冗余引用等机械性优化 2026-05-08 16:35:21 +08:00
5d62141658 1、修复和提升记忆系统 2、简化消息标记 2026-05-08 15:09:27 +08:00
2617558a27 记忆工具合并文件,改成记忆系统总是开启。 2026-05-08 10:28:34 +08:00
c602a0695d feat: add memory system with FTS5 search and context compression integration 2026-05-07 23:32:59 +08:00
2fe953cdad 改为短id 2026-05-07 16:28:54 +08:00
61d2fe9ef0 修复及完善cron任务 2026-05-07 16:24:13 +08:00
db609342f7 fix: char-boundary-safe name truncation in cron_add tool
The name fallback used byte-index slice on the prompt,
which panics on multi-byte UTF-8 characters like Chinese.
Use is_char_boundary() to find a safe truncation point.
2026-05-05 00:56:42 +08:00
62f4326131 refactor: move scheduler store to storage module, cron tools to tools module
- storage/scheduler.rs: ScheduledJob/JobRun types + CRUD on Storage
- tools/cron.rs: 6 cron agent tools (add/list/remove/enable/disable/update)
- scheduler/types.rs: keep only Schedule enum
- scheduler/mod.rs: use Arc<Storage> instead of raw SqlitePool
- gateway/mod.rs: inject Storage directly, replace pool field
- storage/mod.rs: scheduler tables in init_schema
2026-05-05 00:49:54 +08:00
98eb7bea3d 新增跨session消息发送能力 2026-05-04 00:32:24 +08:00
8226e8429d Merge remote-tracking branch 'origin/main' 2026-04-27 22:47:37 +08:00
75a3bf9df4 增加系统提示词框架 2026-04-27 17:07:01 +08:00
ac2333900a 重构: 添加技能加载和获取工具,优化技能管理 2026-04-26 23:35:06 +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