Merge upstream/main into ralph/tool-result-refactor
Resolved conflicts: - pkg/heartbeat/service.go: merged both 'started' field and 'onHeartbeatWithTools' - pkg/tools/edit.go: use validatePath() with ToolResult return - pkg/tools/filesystem.go: fixed return values to use ToolResult - cmd/picoclaw/main.go: kept active setupCronTool, fixed toolsPkg import - pkg/tools/cron.go: fixed Execute return value handling Fixed tests for new function signatures (NewEditFileTool, NewAppendFileTool, NewExecTool) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -33,6 +33,7 @@ type HeartbeatService struct {
|
||||
interval time.Duration
|
||||
enabled bool
|
||||
mu sync.RWMutex
|
||||
started bool
|
||||
stopChan chan struct{}
|
||||
}
|
||||
|
||||
@@ -59,7 +60,7 @@ func (hs *HeartbeatService) Start() error {
|
||||
hs.mu.Lock()
|
||||
defer hs.mu.Unlock()
|
||||
|
||||
if hs.running() {
|
||||
if hs.started {
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -67,6 +68,7 @@ func (hs *HeartbeatService) Start() error {
|
||||
return fmt.Errorf("heartbeat service is disabled")
|
||||
}
|
||||
|
||||
hs.started = true
|
||||
go hs.runLoop()
|
||||
|
||||
return nil
|
||||
@@ -76,10 +78,11 @@ func (hs *HeartbeatService) Stop() {
|
||||
hs.mu.Lock()
|
||||
defer hs.mu.Unlock()
|
||||
|
||||
if !hs.running() {
|
||||
if !hs.started {
|
||||
return
|
||||
}
|
||||
|
||||
hs.started = false
|
||||
close(hs.stopChan)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user