fix(tools): update no subagents message for clarity and remove unnecessary locking in runTask

This commit is contained in:
SHINE-six 2026-03-15 15:30:12 +08:00
parent de6a04bf9c
commit 9a2cf38d54
2 changed files with 1 additions and 5 deletions

View file

@ -108,7 +108,7 @@ func (t *SpawnStatusTool) Execute(ctx context.Context, args map[string]any) *Too
} }
if len(tasks) == 0 { if len(tasks) == 0 {
return NewToolResult("No subagents have been spawned yet.") return NewToolResult("No subagents found for this conversation.")
} }
// Order by creation time (ascending) so spawning order is preserved. // Order by creation time (ascending) so spawning order is preserved.

View file

@ -109,10 +109,6 @@ func (sm *SubagentManager) Spawn(
} }
func (sm *SubagentManager) runTask(ctx context.Context, task *SubagentTask, callback AsyncCallback) { func (sm *SubagentManager) runTask(ctx context.Context, task *SubagentTask, callback AsyncCallback) {
sm.mu.Lock()
task.Status = "running"
sm.mu.Unlock()
// Build system prompt for subagent // Build system prompt for subagent
systemPrompt := `You are a subagent. Complete the given task independently and report the result. systemPrompt := `You are a subagent. Complete the given task independently and report the result.
You have access to tools - use them as needed to complete your task. You have access to tools - use them as needed to complete your task.