According to the search results, the first Pixel phone to have astrophotography mode was the Pixel 3, which was released in 2018. The Night Sight mode was introduced to Pixel 3 and higher phones in 2018, and this is automatically enhanced to Astrophotography Mode when the phones motion sensors detect a stationary setup (i.e. tripod) . Therefore, the Pixel 3 was the first phone to have astrophotography mode.