Reject null input in agent tool parameter validation
JSON null unmarshals into an empty string, so the presence-only
key check let {"input":null} through, running the nested agent
with a blank user message.
Signed-off-by: Bryan Frimin <bryan@getprobo.com>
This commit is contained in:
@@ -83,7 +83,8 @@ func (t *agentTool) Execute(ctx context.Context, arguments string) (ToolResult,
|
||||
}, nil
|
||||
}
|
||||
|
||||
if _, ok := fields["input"]; !ok {
|
||||
raw, ok := fields["input"]
|
||||
if !ok || string(raw) == "null" {
|
||||
return ToolResult{
|
||||
Content: "Missing required parameters: input",
|
||||
IsError: true,
|
||||
|
||||
Reference in New Issue
Block a user