Revert "Replace gemini batch JSON protocol"
This reverts commit f5d76fc3ec.
This commit is contained in:
@@ -655,26 +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:
|
||||
- Switched the primary multi-candidate Gemini Vision response format away from JSON and toward a compact line-based text protocol:
|
||||
- `index|verdict|assessment|recommended|reason_ko|search_hint`
|
||||
- Kept the older JSON parser only as a fallback path instead of the primary success path.
|
||||
- Reduced Gemini Vision output-token budgets again to better match the new shorter line-based format.
|
||||
- Added unit coverage for the new pipe-delimited Gemini batch parser.
|
||||
- Why it changed:
|
||||
- The user-provided log `ai-media-hub-2026-03-17T08-38-47-661Z.log` still showed all Gemini batches failing with JSON output truncated almost immediately:
|
||||
- `"{\"recommend"`
|
||||
- `"{\"recommendations\":[{\""`
|
||||
- `"{\"recommendations\":[{\"index"`
|
||||
- At that point the right fix was no longer “more JSON hardening”, but removing JSON as the primary batch transport format so completed lines can be recovered even when the tail of the response is cut off.
|
||||
- How it was verified:
|
||||
- `pwsh -NoProfile -File scripts/selftest.ps1`
|
||||
- added Go tests for line-based Gemini batch parsing
|
||||
- What is still risky or incomplete:
|
||||
- If Gemini returns text that does not follow either the pipe-delimited format or the JSON fallback shape, parsing can still fail.
|
||||
- The model prompt is now stricter and shorter, which improves reliability, but it can make reasons more terse than before.
|
||||
|
||||
- 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.
|
||||
|
||||
Reference in New Issue
Block a user