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>
This commit is contained in:
yinwm
2026-02-12 19:39:57 +08:00
parent 56ac18ab70
commit 7bcd8b284f
4 changed files with 297 additions and 9 deletions

View File

@@ -107,7 +107,7 @@
"go test ./pkg/heartbeat -run TestAsync passes"
],
"priority": 7,
"passes": false,
"passes": true,
"notes": ""
},
{