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:
Mauro
2026-06-08 18:51:14 +02:00
committed by GitHub
2 changed files with 12 additions and 3 deletions
+8 -2
View File
@@ -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
+4 -1
View File
@@ -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(