You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Migrate to AI SDK v7 (@ai-sdk/google ≥4.0.70) so Gemini receives the full JSON Schema (fixes #139) #141
#139 is reproduced on 0.4.7: @ai-sdk/google 2.0.54's convertJSONSchemaToOpenAPISchema strips additionalProperties (and pattern, min/max, $ref), so Gemini returns {} for map-typed fields. All 5 Gemini PR Explanation runs in aictrl prod on 2026-10-10 lost every diagram element.
The upstream fix is @ai-sdk/google 4.0.70 (vercel/ai#20757, merged 2026-09-14): it sends parametersJsonSchema for tools and responseJsonSchema for outputs, and removes the lossy converter. It ships only on the AI SDK v7 line (provider 4.x, provider-utils 5.x, google-vertex 5.x). The v6 line (google 3.0.131) still converts, and there is no v5/v6 backport. Upstream OpenCode dev is on ai 6.0.168 / google 3.0.73 and has the same bug.
Founder decision (2026-10-10): fix #139 by migrating the SDK, not with a local patch or a contract workaround.
Goal
Move the fork from ai 5.0.124 / @ai-sdk/google 2.0.54 / @ai-sdk/google-vertex 3.0.106 to AI SDK v7 (google ≥ 4.0.70, google-vertex 5.x) across every provider package we use, with no behaviour regressions.
Acceptance Criteria
All ai / @ai-sdk/* / provider-utils packages on the v7 line; lockfile clean; typecheck and the full suite pass.
Gemini native validation reviewed: whether to use functionCallingConfig VALIDATED now that the full schema is sent.
Release notes list the breaking SDK changes handled.
Notes
Scope it first: count ai/@ai-sdk usages and walk the v5→v6→v7 migration guides (streamText/tool APIs, message parts, provider options, usage/finishReason shapes).
Probe on v7: #139 is only partly fixed. The full schema now reaches Gemini (parametersJsonSchema with additionalProperties), and elements comes back with 6 entries instead of {}. But Gemini rewrites the map keys in its function-call response: queued->running→queued__running, 1→_1 or first_step, TASKS.org_id→TASKS_org_id. Ajv accepts the result and the run exits 0, so it's silently corrupted. The array-shaped schema and GLM both came back intact. So map-keyed results aren't safe through Gemini function calling even with the full schema; #140's path form avoids the issue entirely for file-based results.
Closed for now (founder, 2026-10-11): no current driver. #142 (released in 0.4.8) made schema-mode StructuredOutput take only {path}, so the big result schema no longer goes through @ai-sdk/google's lossy converter, and the prod symptom (Gemini PR Explanations with empty diagram elements) is fixed and verified. Upstream anomalyco/opencode closed its own v7 migration PR (#52064) unmerged, so there's no upstream to follow yet either. The scoping notes above stand (4–5 days, risk list). Reopen when a concrete problem needs AI SDK v7, e.g. an MCP tool with a map-typed schema misbehaving on Gemini, or a provider feature only v7 has. A lighter alternative if only Gemini is affected: a native Gemini path that sends parametersJsonSchema (as NousResearch/hermes-agent does in agent/gemini_schema.py).
Activity
byapparov commentedon Oct 10, 2026
Scoping result (2026-10-10). Recommendation: one PR jumping straight to v7, after #140. Estimate 4–5 days.
"unknown"is removed; it affects termination, retry and the processor);messagesare rejected at runtime;strictJsonSchema, Azure/xAI Responses API).Probe on v7: #139 is only partly fixed. The full schema now reaches Gemini (
parametersJsonSchemawithadditionalProperties), andelementscomes back with 6 entries instead of{}. But Gemini rewrites the map keys in its function-call response:queued->running→queued__running,1→_1orfirst_step,TASKS.org_id→TASKS_org_id. Ajv accepts the result and the run exits 0, so it's silently corrupted. The array-shaped schema and GLM both came back intact. So map-keyed results aren't safe through Gemini function calling even with the full schema; #140's path form avoids the issue entirely for file-based results.byapparov commentedon Oct 11, 2026
Closed for now (founder, 2026-10-11): no current driver. #142 (released in 0.4.8) made schema-mode StructuredOutput take only
{path}, so the big result schema no longer goes through @ai-sdk/google's lossy converter, and the prod symptom (Gemini PR Explanations with empty diagram elements) is fixed and verified. Upstream anomalyco/opencode closed its own v7 migration PR (#52064) unmerged, so there's no upstream to follow yet either. The scoping notes above stand (4–5 days, risk list). Reopen when a concrete problem needs AI SDK v7, e.g. an MCP tool with a map-typed schema misbehaving on Gemini, or a provider feature only v7 has. A lighter alternative if only Gemini is affected: a native Gemini path that sendsparametersJsonSchema(as NousResearch/hermes-agent does in agent/gemini_schema.py).