diff --git a/pkg/tools/spawn.go b/pkg/tools/spawn.go index a9a373856..225c2a4b2 100644 --- a/pkg/tools/spawn.go +++ b/pkg/tools/spawn.go @@ -90,8 +90,14 @@ func (t *SpawnTool) execute( return ErrorResult("task is required and must be a non-empty string") } - label, _ := args["label"].(string) - agentID, _ := args["agent_id"].(string) + label, ok := args["label"].(string) + if !ok { + label = "" + } + agentID, ok := args["agent_id"].(string) + if !ok { + agentID = "" + } targetAgentID := strings.TrimSpace(agentID) // Check allowlist if targeting a specific agent diff --git a/pkg/tools/subagent.go b/pkg/tools/subagent.go index feeabe536..1122d5157 100644 --- a/pkg/tools/subagent.go +++ b/pkg/tools/subagent.go @@ -391,7 +391,10 @@ func (t *SubagentTool) Execute(ctx context.Context, args map[string]any) *ToolRe return ErrorResult("task is required").WithError(fmt.Errorf("task parameter is required")) } - label, _ := args["label"].(string) + label, ok := args["label"].(string) + if !ok { + label = "" + } // Build system prompt for subagent systemPrompt := fmt.Sprintf(