From daae4a9107bd02d5886384b690b9a13e01f5f0c3 Mon Sep 17 00:00:00 2001 From: Sudipta Date: Sat, 17 Jan 2026 14:36:57 +0530 Subject: [PATCH 1/3] fix : safely parse EMBEDDING_MAX_BATCH_SIZE with fallback --- backend/config.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/backend/config.py b/backend/config.py index dd5caa3d..7b599aa7 100644 --- a/backend/config.py +++ b/backend/config.py @@ -12,5 +12,9 @@ GITHUB_TOKEN = os.getenv("GITHUB_TOKEN") or os.getenv("GH_TOKEN") MODEL_NAME = os.getenv("EMBEDDING_MODEL", "BAAI/bge-small-en-v1.5") -MAX_BATCH_SIZE = int(os.getenv("EMBEDDING_MAX_BATCH_SIZE", "32")) +try: + MAX_BATCH_SIZE = int(os.getenv("EMBEDDING_MAX_BATCH_SIZE", "32")) +except ValueError: + logging.warning("Invalid integer for EMBEDDING_MAX_BATCH_SIZE. Defaulting to 32.") + MAX_BATCH_SIZE = 32 EMBEDDING_DEVICE = os.getenv("EMBEDDING_DEVICE", "cpu") From 3ece0c63e4cc23055375765ce9e8303b73fae971 Mon Sep 17 00:00:00 2001 From: Sudipta Date: Sat, 17 Jan 2026 15:04:30 +0530 Subject: [PATCH 2/3] fix: add missing logging import --- backend/config.py | 1 + 1 file changed, 1 insertion(+) diff --git a/backend/config.py b/backend/config.py index 7b599aa7..e94c76d4 100644 --- a/backend/config.py +++ b/backend/config.py @@ -1,4 +1,5 @@ from dotenv import load_dotenv, find_dotenv +import logging import os From f44974eb10cb60b0015457c0638b234684fc33f8 Mon Sep 17 00:00:00 2001 From: Sudipta Date: Tue, 3 Feb 2026 20:32:10 +0530 Subject: [PATCH 3/3] refactor: add safe index creation with improved logging --- .../falkor/code-graph-backend/api/graph.py | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/backend/app/database/falkor/code-graph-backend/api/graph.py b/backend/app/database/falkor/code-graph-backend/api/graph.py index 7c91405b..2a134ef9 100644 --- a/backend/app/database/falkor/code-graph-backend/api/graph.py +++ b/backend/app/database/falkor/code-graph-backend/api/graph.py @@ -46,20 +46,20 @@ def __init__(self, name: str) -> None: # Initialize the backlog as disabled by default self.backlog = None - # create indicies + self._safe_create_index(self.g.create_node_range_index, "File", "name", "ext") + self._safe_create_index(self.g.create_node_fulltext_index, "Searchable", "name") - # index File path, name and ext fields + def _safe_create_index(self, func, label, *args): try: - self.g.create_node_range_index("File", "name", "ext") - except Exception: - pass + func(label, *args) + logging.debug(f"Successfully created/verified index for '{label}'.") + except Exception as e: + if "already exists" in str(e).lower(): + logging.info(f"Index for '{label}' already exists.") + else: + logging.error(f"Failed to create index for '{label}': {e}", exc_info=True) - # index Function using full-text search - try: - self.g.create_node_fulltext_index("Searchable", "name") - except Exception: - pass def clone(self, clone: str) -> "Graph": """