Fix potential UnboundLocalError for system_message in tracing decorator

Restore the `system_message = None` initialization that was dropped
when collapsing the OpenAILLMContext branch.
This commit is contained in:
Paul Kompfner
2026-03-31 21:00:51 -04:00
parent ebab75765d
commit 92e34ea6e8

View File

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