From 060fbeba768b2cd26714d7435a1bf6e6e90c60e1 Mon Sep 17 00:00:00 2001 From: Vadym Samoilenko Date: Mon, 16 Mar 2026 13:59:59 +0000 Subject: [PATCH] Fix GeminiService client attribute error in knowledge base distillation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace self.gemini.client with self.gemini.primary_client on line 295 of knowledge_base_service.py. GeminiService only exposes primary_client and fallback_client — there is no client attribute. This caused all processing jobs to fail at the distillation step, which is also why Version History was always blank (no SpecVersion records were ever created). Co-Authored-By: Claude Sonnet 4.6 --- backend/app/services/knowledge_base_service.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/app/services/knowledge_base_service.py b/backend/app/services/knowledge_base_service.py index c58d90a..bfcabaa 100644 --- a/backend/app/services/knowledge_base_service.py +++ b/backend/app/services/knowledge_base_service.py @@ -292,7 +292,7 @@ class KnowledgeBaseService: prompt = prompt_template.format(combined_markdown=combined_markdown) logger.info(f"[KB_SERVICE] Sending {len(combined_markdown)} chars to Gemini for distillation") - response = await self.gemini.client.aio.models.generate_content( + response = await self.gemini.primary_client.aio.models.generate_content( model=self.gemini.model, contents=prompt, )