mirror of
https://github.com/sipeed/picoclaw.git
synced 2026-06-12 18:08:54 +00:00
Merge pull request #3057 from chengzhichao-xydt/codex/subagent-spawn-type-assertions
fix(tools): add ok checks for type assertions in subagent and spawn tools
This commit is contained in:
+8
-2
@@ -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
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user