From c9848210bb474c694869306fe53926871eecb132 Mon Sep 17 00:00:00 2001 From: michael Date: Wed, 7 Jan 2026 13:49:47 -0600 Subject: [PATCH] Add full traceback and SDK version logging for AssertionError debug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This will help identify where exactly the AssertionError is occurring in the google-genai SDK and what version is installed on the server. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 --- backend/app/services/llm_service.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/backend/app/services/llm_service.py b/backend/app/services/llm_service.py index 95b9e04b..13399c0f 100755 --- a/backend/app/services/llm_service.py +++ b/backend/app/services/llm_service.py @@ -10,6 +10,7 @@ import json import asyncio import logging import base64 +import traceback from google import genai from google.genai import errors as genai_errors from openai import AsyncOpenAI @@ -30,6 +31,10 @@ def get_gemini_client(): when caching clients in ASGI environments where requests may come on different event loops. The overhead is minimal compared to the LLM API call. """ + # Log SDK version on first call for debugging + import google.genai as genai_pkg + if hasattr(genai_pkg, '__version__'): + logger.info(f"google-genai SDK version: {genai_pkg.__version__}") return genai.Client(api_key=GEMINI_API_KEY) @@ -307,8 +312,10 @@ class LLMService: exc_repr = repr(e) exc_args = getattr(e, 'args', ()) exc_dict = getattr(e, '__dict__', {}) + exc_tb = traceback.format_exc() logger.warning(f"LLM attempt {attempt_num}/{max_retries} failed - Type: {exc_module}.{exc_type}, str: '{exc_str}', repr: {exc_repr}, args: {exc_args}, dict: {exc_dict}") + logger.warning(f"Full traceback:\n{exc_tb}") error_message = exc_str.lower() if exc_str else exc_repr.lower()