← Engineering Work & Open Source
Merged UpstreamVercel AI SDK · Provider Reliability

Preserving Structured Gemini Error Details in Vercel AI SDK

A reproduced Google-provider error-schema defect, focused patch, and regression fixture that Vercel approved and transferred into factory PR #18662, merged upstream on August 11, 2026.

Ribbsaeter Systems Vercel AI SDK Gemini error details fix merged upstream in PR #18662

#18662

merged upstream

#18629

reported PR

429

Gemini error path

Low

reviewed risk

01 · Engineering problem

The failure mode

Gemini 429 responses can carry google.rpc.QuotaFailure and google.rpc.RetryInfo payloads, but the Google provider schema stripped error.details before the parsed response reached APICallError.data. Applications therefore lost provider-supplied retry timing unless they reparsed the raw response body.

02 · Technical response

What changed

  1. 01Reproduced the loss through the existing Google failed-response handler.
  2. 02Extended the schema with a nullish array of unknown detail payloads instead of over-modeling Google RPC variants.
  3. 03Added a representative 429 fixture containing QuotaFailure, RetryInfo, and retryDelay 34.4s.
  4. 04Verified that the structured details survive parsing without changing retry policy, messages, headers, or successful responses.

03 · Verified outcome

Evidence, not implication

  • Vercel’s bugfix review marked the issue fully addressed with low side-effect and security risk.
  • The accepted fix was transferred from PR #18629 into Vercel factory PR #18662.
  • Factory PR #18662 merged into vercel/ai on August 11, 2026.
  • The final implementation remained additive and backward-compatible.

04 · Public record

Source evidence

Independent engineering and open-source work by Patrick Ribbsaeter / Ribbsaeter Systems. References to maintainers, repositories, or companies identify the public technical context only. No employment, client, vendor, or partnership relationship is implied unless explicitly stated.