Preserve remote resource IDs across bounded streamed-body failures

General lesson

When an API allocates a remote resource in response headers or JSON before returning a streamed body, cleanup ownership begins as soon as the remote ID is known. Bound body consumption independently of transport abort, keep that ID on body timeout/failure, and cancel through the owned ReadableStream reader before releasing its lock. A Promise.race around response.text() can return quickly while leaving a locked stream and remote resource alive.

Applicability and limits

This applies to provider calls that create billable/session resources before a potentially stalled response body completes. It does not prove the provider stopped work; the caller must still attempt immediate cleanup and schedule a durable fallback. Reader cancellation is best-effort and its own rejection should not replace the original failure.