fix: interrupt message speech on confirmation

This commit is contained in:
Xin Wang
2026-08-03 16:30:18 +08:00
parent 8064bb7152
commit 06719e4801
2 changed files with 18 additions and 0 deletions

View File

@@ -19,6 +19,7 @@ from pipecat.flows import (
NodeConfig,
)
from pipecat.frames.frames import (
InterruptionFrame,
LLMRunFrame,
LLMUpdateSettingsFrame,
OutputTransportMessageUrgentFrame,
@@ -1084,6 +1085,14 @@ class WorkflowBrain(BaseBrain):
),
)
if result.succeeded:
if (
completion_policy == MESSAGE_CONFIRMATION
and result.action == "confirmed"
):
# The client-tool result closes the confirmation gate, while
# InterruptionFrame closes any speech still owned by this
# Message before the next node can enqueue new output.
await runtime.queue_frame(InterruptionFrame())
await self._emit_trace(
"message_completed",
nodeId=node_id,