From 9a2cf38d548b1efaf2e4d01e1de2157f40ecd605 Mon Sep 17 00:00:00 2001 From: SHINE-six Date: Sun, 15 Mar 2026 15:30:12 +0800 Subject: [PATCH] fix(tools): update no subagents message for clarity and remove unnecessary locking in runTask --- pkg/tools/spawn_status.go | 2 +- pkg/tools/subagent.go | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/pkg/tools/spawn_status.go b/pkg/tools/spawn_status.go index dd429c1c0..e2aa74d7d 100644 --- a/pkg/tools/spawn_status.go +++ b/pkg/tools/spawn_status.go @@ -108,7 +108,7 @@ func (t *SpawnStatusTool) Execute(ctx context.Context, args map[string]any) *Too } 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. diff --git a/pkg/tools/subagent.go b/pkg/tools/subagent.go index 40c9e6ae9..c37a5ee0f 100644 --- a/pkg/tools/subagent.go +++ b/pkg/tools/subagent.go @@ -109,10 +109,6 @@ func (sm *SubagentManager) Spawn( } 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 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.