From 92e34ea6e88e398722a8b36696d1190e35d6a3be Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Tue, 31 Mar 2026 21:00:51 -0400 Subject: [PATCH] Fix potential UnboundLocalError for system_message in tracing decorator Restore the `system_message = None` initialization that was dropped when collapsing the OpenAILLMContext branch. --- src/pipecat/utils/tracing/service_decorators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/pipecat/utils/tracing/service_decorators.py b/src/pipecat/utils/tracing/service_decorators.py index 8f98026e6..d87955755 100644 --- a/src/pipecat/utils/tracing/service_decorators.py +++ b/src/pipecat/utils/tracing/service_decorators.py @@ -491,6 +491,7 @@ def traced_llm(func: Optional[Callable] = None, *, name: Optional[str] = None) - # Handle system message for different services # settings.system_instruction takes priority (matches service behavior) + system_message = None if hasattr(self, "_settings") and getattr( self._settings, "system_instruction", None ):