EmptyTruncatedReplyMiddleware()Fail the main run when the provider cut off a reply before any output.
Without this, a reply with no text, no tool calls, and a truncation stop reason ends the run as a success. The empty message is checkpointed and the UI shows nothing, so the app looks hung. Raising instead fails the model node, so the empty message is not saved and the client shows the error. A partial reply is left alone; the client warns about it.
This middleware never retries. It must wrap the retry middleware, so the error is not retried, and any recovery middleware that may still repair the reply.