Revert "Harden single-candidate gemini recovery"

This reverts commit b6a217cab9.
This commit is contained in:
GHStaK
2026-03-18 13:00:40 +09:00
parent acfad750ab
commit 770aea0f57
3 changed files with 12 additions and 161 deletions
-18
View File
@@ -655,24 +655,6 @@
- If behavior in the browser does not match the latest backend/frontend code, the first assumption should be stale frontend assets until proven otherwise
## Recent Change Log
- Date: `2026-03-17`
- What changed:
- Added a dedicated single-candidate Gemini recovery path that no longer asks for JSON and instead parses a tiny plain-text key/value response.
- Kept multi-candidate Gemini Vision on compact JSON, but changed sequential recovery to use the shorter plain-text format automatically through the existing `Recommend(..., []SearchResult{item})` path.
- Added unit coverage for the single-candidate plain-text parser.
- Why it changed:
- The user-provided log `ai-media-hub-2026-03-17T08-20-31-074Z.log` showed even more severe truncation:
- `"{\"recommendations\":[{\"index\":"`
- `"{\"recommendations"`
- `"{\"recommend"`
- The same log showed `sequentialRetried: 0`, which means the old single-candidate recovery path was still too verbose and was not successfully rescuing failed batches.
- How it was verified:
- `pwsh -NoProfile -File scripts/selftest.ps1`
- added Go tests for single-candidate Gemini plain-text parsing
- What is still risky or incomplete:
- If Gemini returns malformed plain text that omits the required `verdict:` line, even the single-candidate recovery path can still fail.
- This improves recovery robustness, but total Gemini latency can still rise when many batch failures fall back to candidate-by-candidate evaluation.
- Date: `2026-03-17`
- What changed:
- Added adaptive Gemini Vision output-token sizing so smaller candidate batches, especially single-candidate sequential recovery calls, now request much shorter responses.