From fb74c00686bcab0a308d79e4a52385210286e713 Mon Sep 17 00:00:00 2001 From: rarebuffalo Date: Mon, 15 Jun 2026 00:42:06 +0530 Subject: [PATCH] fix backend router to use effective_ai_key instead of ai_api_key --- app/routers/code_scan.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/routers/code_scan.py b/app/routers/code_scan.py index c5590e8..47f886f 100644 --- a/app/routers/code_scan.py +++ b/app/routers/code_scan.py @@ -138,7 +138,7 @@ async def chat_with_scan( We load the scan from PostgreSQL using the scan_id, so this works correctly across server restarts and multiple workers. """ - if not settings.ai_api_key: + if not settings.effective_ai_key: raise HTTPException( status_code=400, detail="AI Chat is disabled because no AI API key is configured.", @@ -285,12 +285,12 @@ async def list_available_models(): Lists AI models available to the configured provider. Only meaningful when using the Gemini provider. """ - if not settings.ai_api_key: + if not settings.effective_ai_key: raise HTTPException(status_code=500, detail="No AI API key is set.") try: from google import genai - client = genai.Client(api_key=settings.ai_api_key) + client = genai.Client(api_key=settings.effective_ai_key) models = [] for model in client.models.list(): if "generateContent" in model.supported_actions: