Repository navigation
fix: use a served Gemini model and a JSON-Schema-safe feedback schema - #13
Merged
Merged
Conversation
Feedback generation was failing in production for two independent reasons found by the first live LLM call since the rebuild: 1. gemini-2.0-flash-001 has been retired by Google (rejected with a pointer to gemini-3.6-flash). The model id now lives only in config/llm.ts; both legacy call sites use it. 2. feedbackSchema used z.tuple, which compiles to JSON Schema `items: [...]`; Google's structured-output API rejects that. The legacy app hid this via structuredOutputs:false, removed with AI SDK 7. The schema is now a bounded array with an enum `name`, and a regression test asserts the compiled JSON Schema shape. Verified live: structured generation and the full feedback prompt + schema succeed on gemini-3.6-flash (total score and five categories returned). RISKS: R26 closed (key valid); R27 added (model retirement, reasoning-token caps, transient 429s → P2.3 contract test + fallback). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first live LLM call since the rebuild (possible now that the Gemini key is valid) showed feedback generation failing for two independent reasons:
gemini-2.0-flash-001is retired — Google rejects it and points togemini-3.6-flash. Model id now lives only inconfig/llm.ts(→config/providers.tsin P2.3).feedbackSchemausedz.tuple, which compiles to JSON Schemaitems: [...]— Google's structured-output API rejects it. The legacy app hid this withstructuredOutputs: false, which AI SDK 7 removed. Now a bounded array with an enumname, plus a regression test on the compiled JSON Schema.Type
Verification
pnpm lint✔ ·typecheck✔ ·vitest46/46 (new: JSON-Schema shape + parse/reject tests)gemini-3.6-flash✔; full feedback prompt + schema → total 88 with five categories, 1 084 tokens, ~13 s ✔PING→PONG(for P1.5)Risk watch-list
🤖 Generated with Claude Code