From a5bb9f65dee326b719fa3f8a9cb21fbddd9a320f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 14 May 2026 16:33:53 -0700 Subject: [PATCH] Fix LLMTask._finish_function_call to bypass deferral self.queue_frame would defer the LLMMessagesAppendFrame because _finish_function_call always runs inside a tool call. The subsequent _flush_pipeline() then returned before the goodbye/handoff LLM output was actually delivered. Use super().queue_frame to push the frame straight into the pipeline, matching the pattern used in _flush_pipeline(). --- src/pipecat/tasks/llm/llm_task.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pipecat/tasks/llm/llm_task.py b/src/pipecat/tasks/llm/llm_task.py index c652ba60e..0a6a01c6f 100644 --- a/src/pipecat/tasks/llm/llm_task.py +++ b/src/pipecat/tasks/llm/llm_task.py @@ -327,7 +327,10 @@ class LLMTask(PipelineTask): messages: Optional LLM messages to inject before completing. """ if messages: - await self.queue_frame(LLMMessagesAppendFrame(messages=messages, run_llm=True)) + # Bypass our deferral override: this runs inside a tool call, so + # self.queue_frame would defer the frame and the flush below would + # return before the LLM output is delivered. + await super().queue_frame(LLMMessagesAppendFrame(messages=messages, run_llm=True)) await self._flush_pipeline() if not result_callback: