fix(similarity): address code review - column-only queries, configurable batch size, WCAG touch targets

- Use column-only query in embeddings overview to reduce memory for 100K+ files
- Add embedding_backfill_batch_size config setting (default 50)
- Fix WCAG touch target on backfill button (min-height/min-width 44px)
- Add inline comment explaining 3 chars/token truncation estimate
- Import settings in compute_embedding task for configurable batch size

Co-authored-by: christianlouis <361235+christianlouis@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-03-02 13:39:10 +00:00
parent 8e955f3c81
commit 55543be3b0
5 changed files with 23 additions and 5 deletions
+2 -1
View File
@@ -9,6 +9,7 @@ import logging
from datetime import datetime, timezone
from app.celery_app import celery
from app.config import settings
from app.database import SessionLocal
from app.models import FileRecord
from app.tasks.retry_config import BaseTaskWithRetry
@@ -145,7 +146,7 @@ def backfill_missing_embeddings(self) -> dict:
Returns:
A dict with the number of tasks ``queued``.
"""
batch_size = 50 # max files to queue per run
batch_size = settings.embedding_backfill_batch_size
task_id = self.request.id
logger.info("[%s] Backfill: scanning for files missing embeddings (batch_size=%d)", task_id, batch_size)