fix(realtime): complete workflow message transitions

This commit is contained in:
Xin Wang
2026-08-05 11:25:50 +08:00
parent 17b5e10ed1
commit 11374238f3
4 changed files with 115 additions and 7 deletions

View File

@@ -909,7 +909,22 @@ async def run_realtime_pipeline(
call_end = CallEndCoordinator(queue_call_end)
client_tools = ClientToolBroker()
client_tools.set_interrupt_handler(realtime.interrupt)
async def interrupt_for_client_tool_result() -> None:
"""Release confirmations after the realtime response is interrupted.
Fixed Message speech intentionally suppresses the provider transcript,
so the text aggregator may have no assistant turn from which to emit an
``on_interruption_processed`` event. The realtime adapter owns and
clears that response state itself. Wait for the provider boundary as
well, matching Pipeline's rule that the next node cannot generate until
the interrupted response has fully finished.
"""
await realtime.interrupt()
await realtime.wait_for_response_boundary()
client_tools.on_interruption_processed()
client_tools.set_interrupt_handler(interrupt_for_client_tool_result)
user_input = RealtimeUserInputProcessor(
should_ignore_input=lambda: (
call_end.ending or not input_state["enabled"]