Merge pull request #3413 from pipecat-ai/aleix/fix-assistant-thought-aggregation

LLMAssistantAggregator: reset aggregation after adding the thought, not before
This commit is contained in:
Aleix Conchillo Flaqué
2026-01-12 09:21:42 -08:00
committed by GitHub

View File

@@ -950,7 +950,6 @@ class LLMAssistantAggregator(LLMContextAggregator):
return
thought = concatenate_aggregated_text(self._thought_aggregation)
await self._reset_thought_aggregation()
if self._thought_append_to_context:
llm = self._thought_llm
@@ -966,6 +965,9 @@ class LLMAssistantAggregator(LLMContextAggregator):
)
message = AssistantThoughtMessage(content=thought, timestamp=self._thought_start_time)
await self._reset_thought_aggregation()
await self._call_event_handler("on_assistant_thought", message)
def _context_updated_task_finished(self, task: asyncio.Task):