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:
Bryan Frimin
2026-03-13 19:57:18 +01:00
parent 9d999559f1
commit d80a0fa7e4
2 changed files with 23 additions and 1 deletions

View File

@@ -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,