picoclaw/pkg
yinwm 35fa64cde8 feat: US-015 - Add EditTool tests
Added comprehensive test coverage for EditTool (EditFileTool, AppendFileTool) with 10 test cases:
- TestEditTool_EditFile_Success: Verifies successful file editing
- TestEditTool_EditFile_NotFound: Verifies error handling for non-existent files
- TestEditTool_EditFile_OldTextNotFound: Verifies error when old_text not found
- TestEditTool_EditFile_MultipleMatches: Verifies error for multiple occurrences
- TestEditTool_EditFile_OutsideAllowedDir: Verifies directory restriction
- TestEditTool_EditFile_MissingPath: Verifies missing path parameter
- TestEditTool_EditFile_MissingOldText: Verifies missing old_text parameter
- TestEditTool_EditFile_MissingNewText: Verifies missing new_text parameter
- TestEditTool_AppendFile_Success: Verifies successful file appending
- TestEditTool_AppendFile_MissingPath: Verifies missing path for append
- TestEditTool_AppendFile_MissingContent: Verifies missing content for append

EditTool implementation already conforms to ToolResult specification:
- EditFile returns SilentResult('File edited: ...')
- AppendFile returns SilentResult('Appended to ...')
- Errors return ErrorResult with IsError=true

EditFileTool includes security feature: optional directory restriction to prevent editing files outside allowed paths.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:55:57 +08:00
..
agent feat: US-010 - Add RecordLastChannel to AgentLoop with atomic state save 2026-02-12 19:49:36 +08:00
auth feat(auth): add OAuth and token-based login for OpenAI and Anthropic 2026-02-11 11:41:13 -06:00
bus * First commit 2026-02-09 19:20:19 +08:00
channels refactor(channels): consolidate media handling and improve resource cleanup 2026-02-12 12:46:28 +08:00
config Merge branch 'main' into issue-31-feat-add-slack-channel-integration-with-socket-mode-threads-reactions-and-slash-commands 2026-02-12 11:59:05 +08:00
cron refactor(agent): improve code quality and restore summarization 2026-02-11 20:31:41 +08:00
heartbeat feat: US-007 - Add heartbeat async task execution support 2026-02-12 19:39:57 +08:00
logger * First commit 2026-02-09 19:20:19 +08:00
migrate feat(migrate): add picoclaw migrate command for OpenClaw workspace migration 2026-02-11 12:48:16 -06:00
providers chore(deps): upgrade openai-go from v1.12.0 to v3.21.0 2026-02-11 13:39:19 -06:00
session fix(cron): add one-time reminders and fix data paths to workspace 2026-02-11 20:31:41 +08:00
skills Add memory system, dynamic tool loading, and fix logging issues 2026-02-11 00:14:33 +08:00
state feat: US-009 - Add state save atomicity with SetLastChannel 2026-02-12 19:46:10 +08:00
tools feat: US-015 - Add EditTool tests 2026-02-12 19:55:57 +08:00
utils refactor(channels): consolidate media handling and improve resource cleanup 2026-02-12 12:46:28 +08:00
voice Remove duplicate truncate functions, reuse utils.Truncate 2026-02-12 00:46:48 +08:00