add sessions tool and subagents steer control

This commit is contained in:
DBT
2026-02-23 13:13:06 +00:00
parent 89847f5672
commit 5f8678f091
5 changed files with 185 additions and 5 deletions

View File

@@ -3,6 +3,7 @@ package tools
import (
"context"
"fmt"
"strings"
"sync"
"time"
@@ -22,6 +23,7 @@ type SubagentTask struct {
OriginChatID string
Status string
Result string
Steering []string
Created int64
Updated int64
}
@@ -230,3 +232,19 @@ func (sm *SubagentManager) KillTask(taskID string) bool {
}
return true
}
func (sm *SubagentManager) SteerTask(taskID, message string) bool {
sm.mu.Lock()
defer sm.mu.Unlock()
t, ok := sm.tasks[taskID]
if !ok {
return false
}
message = strings.TrimSpace(message)
if message == "" {
return false
}
t.Steering = append(t.Steering, message)
t.Updated = time.Now().UnixMilli()
return true
}