Skip to content

Upgrade AI SDK providers, zod 4, TypeScript 7; fix empty Gemini typing - #19

Merged
jkudish merged 5 commits into
mainfrom
deps/majors
Sep 25, 2026
Merged

jkudish merged 5 commits into
mainfrom
deps/majors

Conversation

@jkudish

@jkudish jkudish commented Sep 25, 2026

Copy link
Copy Markdown
Owner

Brings the major dependencies current and fixes empty Gemini typing.

AI SDK providers 2.x → 4.x (openai-compatible 1.x → 3.x). ai@7 was already installed, but the old providers implement model spec v2, so every typing call ran through ai@7's compatibility shim (with a warning on stderr). The v4 providers remove the shim and the HIGH undici advisory that came in through provider-utils@3; npm audit --omit=dev is now clean. The exact @ai-sdk/google pin becomes a caret range. A unit test asserts every typing provider builds a native spec-v4 model.

zod 3 → 4. No source changes. Contract differences, reviewed and accepted:

  • The advertised input schema no longer carries additionalProperties: false (the MCP SDK converts zod 4 in input mode). Runtime still strips unknown keys.
  • start_url is trimmed and has tabs/newlines removed by .url() before validation (same normalization new URL() applies).
  • .int() fields reject integers beyond 2^53−1.

TypeScript 7. "types": ["node"] in tsconfig; emit is byte-identical to 5.9 except sourcemaps.

Fix: Gemini typing returned empty text. Gemini 2.5 Flash spent the 48-token cap on hidden thinking (reproduced on both provider versions). Google now gets a 256-token cap, and Flash models get reasoning: "none" (thinking budget 0 on 2.5, minimum level on 3+). Pro and pre-2.5 models keep default thinking because they reject those settings. README updated.

Verified: clean npm ci, typecheck, build, unit tests (73/73), live e2e (39/39) against TypeSafe and OpenRouter typing, a full navigation with Gemini typing (searched "Ristretto" via google), and live typing on gemini-2.5-flash, 2.5-flash-lite, 3-flash-preview, and 3.1-pro-preview. The OpenAI provider is covered by mocked request tests only (no valid key in the test environment).

@jkudish
jkudish merged commit dc47671 into main Sep 25, 2026
1 check passed
jkudish added a commit that referenced this pull request Sep 25, 2026
AI SDK 7 provider packages + Gemini Flash typing fix via #19,
zod 4 + TS 7 internals, dependency updates, agent skill in package.

Amp-Thread-ID: https://ampcode.com/threads/T-01a0d53e-c271-716f-94dd-6df00c40c7b8
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.

1 participant