From a87778065e9455e95856e40d82c436dee3157c14 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 20 Dec 2025 14:38:37 -0600 Subject: [PATCH] Add debug logging for memory handling --- custom_components/groqd/conversation.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/custom_components/groqd/conversation.py b/custom_components/groqd/conversation.py index f69b697..fc708e1 100644 --- a/custom_components/groqd/conversation.py +++ b/custom_components/groqd/conversation.py @@ -276,6 +276,15 @@ class GroqdConversationEntity( elif memory_scope == "global": memory_key = "global" + LOGGER.debug( + "Memory scope=%s memory_key=%s conv_id=%s device_id=%s user_id=%s", + memory_scope, + memory_key, + user_input.conversation_id, + user_input.device_id, + user_input.context.user_id if user_input.context else None, + ) + if memory_scope == "conversation": if user_input.conversation_id is not None: conversation_id = user_input.conversation_id @@ -291,6 +300,13 @@ class GroqdConversationEntity( conversation_id = ulid.ulid_now() history = [] + LOGGER.debug( + "Conversation id=%s history_len=%s memory_scope=%s", + conversation_id, + len(history), + memory_scope, + ) + if ( user_input.context and user_input.context.user_id @@ -475,6 +491,12 @@ class GroqdConversationEntity( await self._store.async_save( {"history": self._persisted_history, "memory_index": self._memory_index} ) + LOGGER.debug( + "Persisted memory_key=%s history_len=%s conv_id=%s", + memory_key, + len(history), + conversation_id, + ) intent_response.async_set_speech(response.content or "") return conversation.ConversationResult(