From a9a6a5f29db53dfa343e033abe862eb9aad4859c Mon Sep 17 00:00:00 2001 From: Ari Webb Date: Fri, 20 Feb 2026 16:36:04 -0800 Subject: [PATCH] fix: add correct logging (#9603) --- letta/interfaces/openai_streaming_interface.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/letta/interfaces/openai_streaming_interface.py b/letta/interfaces/openai_streaming_interface.py index 8823513e..966fe408 100644 --- a/letta/interfaces/openai_streaming_interface.py +++ b/letta/interfaces/openai_streaming_interface.py @@ -320,9 +320,6 @@ class OpenAIStreamingInterface: # Track events for diagnostics self.total_events_received += 1 self.last_event_type = "ChatCompletionChunk" - # Track events for diagnostics - self.total_events_received += 1 - self.last_event_type = "ChatCompletionChunk" if not self.model or not self.message_id: self.model = chunk.model @@ -833,6 +830,10 @@ class SimpleOpenAIStreamingInterface: prev_message_type: Optional[str] = None, message_index: int = 0, ) -> AsyncGenerator[LettaMessage | LettaStopReason, None]: + # Track events for diagnostics + self.total_events_received += 1 + self.last_event_type = "ChatCompletionChunk" + if not self.model or not self.message_id: self.model = chunk.model self.message_id = chunk.id