mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-05-07 12:07:29 +08:00
tighten device action args validation and normalize media payload schema
This commit is contained in:
@@ -95,6 +95,11 @@ func (t *NodesTool) Execute(ctx context.Context, args map[string]interface{}) (s
|
||||
}
|
||||
reqArgs["duration_ms"] = di
|
||||
}
|
||||
if action == "canvas_action" {
|
||||
if act, _ := reqArgs["action"].(string); strings.TrimSpace(act) == "" {
|
||||
return "", fmt.Errorf("invalid_args: canvas_action requires args.action")
|
||||
}
|
||||
}
|
||||
resp, err := t.router.Dispatch(ctx, nodes.Request{Action: action, Node: nodeID, Args: reqArgs}, mode)
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
||||
Reference in New Issue
Block a user