Fix Gemini candidate cap causing search 500s
build-push / docker (push) Successful in 4m12s

This commit is contained in:
AI Assistant
2026-03-13 19:40:30 +09:00
parent e4262613c3
commit d8cc32e2e7
3 changed files with 18 additions and 1 deletions
+11
View File
@@ -117,6 +117,17 @@
- new service layer file: `backend/services/ranker.go`
- handler is now thinner and less coupled to search internals
## Current Session Update (2026-03-13, 500 Fix)
- A server-side `request failed (500)` regression was found after the ranker split.
- Root cause:
- Gemini candidate cap logic returned `12` even when only `9` ranked candidates existed
- Gemini batch slicing then attempted to read beyond the available slice bounds
- Fix applied:
- `GeminiCandidateLimit` now never exceeds the real candidate count for totals up to 12
- Gemini evaluation now stays within valid ranked slice bounds
- Effect:
- avoids backend 500 during the Gemini Vision evaluation stage for mid-sized result sets
## Local Self-Test Workflow
- Primary command:
- `bash scripts/selftest.sh`