fix: await message confirmation interruption

This commit is contained in:
Xin Wang
2026-08-03 17:11:43 +08:00
parent 67389fc5a1
commit c3cb410c17
5 changed files with 48 additions and 9 deletions

View File

@@ -8,7 +8,6 @@ from unittest.mock import AsyncMock, patch
from models import AssistantConfig, RuntimeTool
from pipecat.flows import FlowManager
from pipecat.frames.frames import (
InterruptionFrame,
LLMContextFrame,
LLMFullResponseEndFrame,
LLMFullResponseStartFrame,
@@ -1536,14 +1535,15 @@ class WorkflowBrainTests(unittest.IsolatedAsyncioTestCase):
async def queue_frame(frame):
if isinstance(frame, TTSSpeakFrame):
events.append(("speech", frame.text))
elif isinstance(frame, InterruptionFrame):
events.append("interrupted")
elif (
isinstance(frame, OutputTransportMessageUrgentFrame)
and frame.message.get("event") == "message_completed"
):
events.append("message_completed")
async def interrupt_output():
events.append("interrupted")
class OrderedCallEnd(FakeCallEnd):
def __init__(self):
super().__init__()
@@ -1580,6 +1580,7 @@ class WorkflowBrainTests(unittest.IsolatedAsyncioTestCase):
call_end=call_end,
client_tools=client_tools,
set_input_enabled=input_states.append,
interrupt_output=interrupt_output,
)
brain._message_stages.set_client_tools(client_tools)