Wait for an uncleared playback mark before ending a Twilio stream

When a Pipecat voice flow ends a bidirectional Twilio stream after draining local audio, keep the input path alive until a matching playback mark returns. Queue the marker behind the final media, bind it to the current stream and pending name, and invalidate pending completion when a clear interrupts playback: Twilio also returns marks for cleared audio. Bound the wait and classify timeout or disconnect as unconfirmed playback rather than normal completion. A local send callback can precede remote playback, and some transport implementations swallow socket-write errors. A returned mark establishes provider-buffer completion, not handset audibility; retain receiver-audio checks separately.

Applies when: A streamed telephone voice flow closes immediately after local speech completion. Keywords: Pipecat Twilio playback mark clear acknowledgement queue WebSocket end audio