Files
picoclaw/pkg/heartbeat/service_test.go
yinwm 7bcd8b284f feat: US-007 - Add heartbeat async task execution support
- Add local ToolResult struct definition to avoid circular dependencies
- Define HeartbeatHandler function type for tool-supporting callbacks
- Add SetOnHeartbeatWithTools method to configure new handler
- Add ExecuteHeartbeatWithTools public method
- Add internal executeHeartbeatWithTools implementation
- Update checkHeartbeat to prefer new tool-supporting handler
- Detect and handle async tasks (log and return immediately)
- Handle error results with proper logging
- Add comprehensive tests for async, error, sync, and nil result cases

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:39:57 +08:00

4.6 KiB