diff --git a/src/ValueObjects/ToolCall.php b/src/ValueObjects/ToolCall.php index 7329979ed..7e7ed1385 100644 --- a/src/ValueObjects/ToolCall.php +++ b/src/ValueObjects/ToolCall.php @@ -36,11 +36,13 @@ public function arguments(): array $arguments = $this->arguments; - return json_decode( + $decoded = json_decode( $arguments, true, flags: JSON_THROW_ON_ERROR ); + + return is_array($decoded) ? $decoded : []; } /** @var array $arguments */