From 6a5e2a067abafe1efbf1ad7bb375bba33c19a5c8 Mon Sep 17 00:00:00 2001 From: Your Name Date: Sat, 20 Dec 2025 11:44:46 -0600 Subject: [PATCH] Coerce context message limit to int --- custom_components/groqd/conversation.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/custom_components/groqd/conversation.py b/custom_components/groqd/conversation.py index f957c37..df0af16 100644 --- a/custom_components/groqd/conversation.py +++ b/custom_components/groqd/conversation.py @@ -350,6 +350,10 @@ class GroqdConversationEntity( history = messages[1:] limit = options.get(CONF_CONTEXT_MESSAGES, DEFAULT_CONTEXT_MESSAGES) + try: + limit = int(limit) + except (TypeError, ValueError): + limit = DEFAULT_CONTEXT_MESSAGES if limit == 0: history = [] elif limit > 0: