Skip to content

fix: use a served Gemini model and a JSON-Schema-safe feedback schema - #13

Merged
Jeston10 merged 1 commit into
milestone/p1-securityfrom
fix/gemini-model-id
Sep 20, 2026
Merged

Jeston10 merged 1 commit into
milestone/p1-securityfrom
fix/gemini-model-id

Conversation

@Jeston10

Copy link
Copy Markdown
Owner

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:

  1. gemini-2.0-flash-001 is retired — Google rejects it and points to gemini-3.6-flash. Model id now lives only in config/llm.ts (→ config/providers.ts in P2.3).
  2. feedbackSchema used z.tuple, which compiles to JSON Schema items: [...] — Google's structured-output API rejects it. The legacy app hid this with structuredOutputs: false, which AI SDK 7 removed. Now a bounded array with an enum name, plus a regression test on the compiled JSON Schema.

Type

  • fix

Verification

  • pnpm lint ✔ · typecheck ✔ · vitest 46/46 (new: JSON-Schema shape + parse/reject tests)
  • Live: structured generation on gemini-3.6-flash ✔; full feedback prompt + schema → total 88 with five categories, 1 084 tokens, ~13 s ✔
  • Upstash REST PING → PONG (for P1.5)

Risk watch-list

  • R26 closed (key valid). R27 added: model retirement, reasoning-token caps, transient 429s — contract test + fallback in P2.3.

🤖 Generated with Claude Code

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>
Copilot AI lite review requested due to automatic review settings September 20, 2026 10:46
@vercel

vercel Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
just-prep-ai-interview-z3cv Error Error Sep 20, 2026 10:47am UTC

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@Jeston10
Jeston10 merged commit 151d4f2 into milestone/p1-security Sep 20, 2026
6 of 7 checks passed
@Jeston10
Jeston10 deleted the fix/gemini-model-id branch September 20, 2026 10:49

This branch had an error being deployed

1 failed deployment
Preview — ebb7f45e Deployed Sep 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants