Skip to content

fix(grpc): deliver the final stream transcript under backpressure - #1

Merged
autoantohaki merged 1 commit into
mainfrom
fix/grpc-stream-final-under-backpressure
Oct 22, 2026
Merged

autoantohaki merged 1 commit into
mainfrom
fix/grpc-stream-final-under-backpressure

Conversation

@autoantohaki

Copy link
Copy Markdown
Member

Requested by mau

Before: when a StreamTranscribe client read responses more slowly than the server produced interim updates, the committed final transcript could be dropped. The output queue (8 events) was full at commit time, try_send failed, and the client received RESOURCE_EXHAUSTED: voice capacity is busy instead of its final text.

After: the final transcript waits for queue capacity, the same way interim updates already do, so every successful commit delivers its final event.

How: the commit arm now awaits sender.send(...) and returns. If the receiver is gone, the stream simply ends. A new network test (stream_final_transcript_waits_for_a_full_output_queue) uses a fake session that emits a multiple of the queue size in interims before commit. It fails on main with ResourceExhausted and passes with this change.

StreamTranscribe sent the committed final transcript with try_send, so a
full output queue turned a successful commit into RESOURCE_EXHAUSTED and
the final text was lost. Await queue capacity like interim updates do.
@autoantohaki
autoantohaki force-pushed the fix/grpc-stream-final-under-backpressure branch from 0958bf0 to 28f10b0 Compare October 22, 2026 01:27
@autoantohaki
autoantohaki merged commit 10de010 into main Oct 22, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant