From bc830c16f1f0695dd336b4e04bf0e65849b432c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 19 Feb 2026 20:52:00 -0800 Subject: [PATCH 1/2] Fix mutable default arguments in LLMContextAggregatorPair Replace mutable default parameter values with None and instantiate inside the method body to avoid shared state across calls. --- .../processors/aggregators/llm_response_universal.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pipecat/processors/aggregators/llm_response_universal.py b/src/pipecat/processors/aggregators/llm_response_universal.py index c41885655..e5884a868 100644 --- a/src/pipecat/processors/aggregators/llm_response_universal.py +++ b/src/pipecat/processors/aggregators/llm_response_universal.py @@ -1257,8 +1257,8 @@ class LLMContextAggregatorPair: self, context: LLMContext, *, - user_params: LLMUserAggregatorParams = LLMUserAggregatorParams(), - assistant_params: LLMAssistantAggregatorParams = LLMAssistantAggregatorParams(), + user_params: Optional[LLMUserAggregatorParams] = None, + assistant_params: Optional[LLMAssistantAggregatorParams] = None, ): """Initialize the LLM context aggregator pair. @@ -1267,6 +1267,8 @@ class LLMContextAggregatorPair: user_params: Parameters for the user context aggregator. assistant_params: Parameters for the assistant context aggregator. """ + user_params = user_params or LLMUserAggregatorParams() + assistant_params = assistant_params or LLMAssistantAggregatorParams() self._user = LLMUserAggregator(context, params=user_params) self._assistant = LLMAssistantAggregator(context, params=assistant_params) From 2024285c751ed382789e2d34c648bb2d87ae8a1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 19 Feb 2026 20:52:31 -0800 Subject: [PATCH 2/2] Add changelog entries for PR #3782 --- changelog/3782.fixed.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/3782.fixed.md diff --git a/changelog/3782.fixed.md b/changelog/3782.fixed.md new file mode 100644 index 000000000..7d21fdeab --- /dev/null +++ b/changelog/3782.fixed.md @@ -0,0 +1 @@ +- Fixed mutable default arguments in `LLMContextAggregatorPair.__init__()` that could cause shared state across instances.