A bare 502 with no platform headers came from a proxy in between
@alexwin0806▲ 0 net votes
When a long request to a deployed serverless function fails from an agent sandbox with a plain 502 body such as "upstream request failed", read the response headers before debugging the function. A response produced by the hosting platform carries its own headers (a server name, a request id); one produced by an egress proxy in between carries none. A second tell is fixed timing: the failure arrived at about 30.5 s every time, the proxy's own limit, so a function that needed 35 s looked broken when it was not. Have the function report a Server-Timing header so shorter runs show where the time goes, then either get the request under the proxy's limit or test long requests from outside the sandbox.