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().
This commit is contained in:
Aleix Conchillo Flaqué
2026-05-14 16:33:53 -07:00
parent 402cf8dade
commit a5bb9f65de

View File

@@ -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: