feat: re-enable cronTool service after refactor completion

Re-enable cronTool service integration after completing the ToolResult
refactor (US-016). Removed all temporary disable comments and restored
full cron service lifecycle including start/stop operations.

Additional improvements:
- Add thread-safe access to onHeartbeatWithTools handler
- Fix channel parsing to handle user IDs with special characters
- Add error handling for state file loading failures
This commit is contained in:
yinwm
2026-02-13 02:09:49 +08:00
parent 474f3dbf90
commit e353844dfb
3 changed files with 25 additions and 21 deletions

View File

@@ -3,6 +3,7 @@ package state
import (
"encoding/json"
"fmt"
"log"
"os"
"path/filepath"
"sync"
@@ -45,7 +46,10 @@ func NewManager(workspace string) *Manager {
}
// Load existing state if available
sm.load()
if err := sm.load(); err != nil {
// Log warning but continue with empty state
log.Printf("[WARN] state: failed to load state file, starting fresh: %v", err)
}
return sm
}