Count wire attempts and durable retries separately.Body size answers what was sent; it does not answer how many times.

Join four timelines.

Contextcomplete history

Each step rebuilds model-facing surface messages.

Recoveryclosed-step retry

Every visible retry records delay and identity.

TransportSSE lifecycle

Trace cancellation through both proxy directions.

One visible retry owner.

0

pi-ai SDK retries

2

default transient retries

Exact

in-cap Retry-After delay

Abort

signal + iterator teardown

Do not use always mode to diagnose overload.

It can retry permanent failures without a request limit.

Use the complete incident runbook.

The canonical guide covers request reconstruction, retry ownership, Retry-After, cancellation, gateway evidence, request-size controls, and a publish-safe checklist.

Read the complete guide