Revert "Harden gemini vision JSON recovery"

This reverts commit 513199f426.
This commit is contained in:
GHStaK
2026-03-18 13:00:41 +09:00
parent 9a33ecc6b5
commit 40a2f817fd
4 changed files with 16 additions and 177 deletions
-16
View File
@@ -655,22 +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:
- Reduced Gemini Vision batch size from `6` to `4` so each model response carries fewer recommendation objects and is less likely to be truncated mid-JSON.
- Tightened the Gemini Vision prompt to ask for shorter Korean reasons and compact JSON-only output.
- Lowered Gemini Vision `maxOutputTokens` and added partial JSON recovery so already-complete recommendation objects can still be salvaged when the model output is cut off before the final closing braces.
- Added unit coverage for truncated Gemini Vision JSON recovery.
- Why it changed:
- The user-provided log `ai-media-hub-2026-03-17T07-29-44-949Z.log` showed that visuals were prepared successfully, but every batch failed with `gemini vision JSON extraction failed: no complete JSON object found ...`.
- The failure pattern indicates output truncation rather than missing thumbnails or preview frames.
- How it was verified:
- `pwsh -NoProfile -File scripts/selftest.ps1`
- added Go tests for partial Gemini JSON recovery behavior
- What is still risky or incomplete:
- If Gemini returns severely malformed output before even one full recommendation object closes, the parser still cannot recover useful results from that batch.
- Smaller batch size improves reliability but can increase total Gemini round trips and latency on some searches.
- Date: `2026-03-17`
- What changed:
- Fixed a search-budget regression where source collection could consume the full `SearchService` deadline and leave no time for Envato / Artgrid enrichment, causing Gemini to see only missing or low-value visuals.