✓ PASS

vercel-ai 7.0.153

stream.error-midstream · gemini

Back to results · Scenario

Requirements

IdLevelStatusEvidence
error-reportedMUSTSATISFIEDoutcome=returned; error.category="api"; finish.value="error" (primary: fullStream.finish.finishReason); truth.finish="error"

What the provider sent

Finish
error
Raw finish
null
Text
Octop
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 22,
  "output": 2,
  "raw": {
    "candidatesTokenCount": 2,
    "promptTokenCount": 22,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 22
      }
    ],
    "serviceTier": "standard",
    "totalTokenCount": 24
  },
  "reasoning": null,
  "total": 24
}
Stream completed
false
Error
Message
This model is currently experiencing high demand. Spikes in demand are usually temporary. Please try again later.
Status
null
Type
UNAVAILABLE
Code
503
Wire excerpt
status: 200
content-type: text/event-stream
body (sse):
data: {"candidates": [{"content": {"parts": [{"text": "Octop"}],"role": "model"},"index": 0}],"usageMetadata": {"promptTokenCount": 22,"candidatesTokenCount": 2,"totalTokenCount": 24,"promptTokensDetails": [{"modality": "TEXT","tokenCount": 22}],"serviceTier": "standard"},"modelVersion": "gemini-3.5-flash-lite","responseId": "pgTOaonbKMuV_uMPvK7d4AE"}


data: {"error":{"code":503,"message":"This model is currently experiencing high demand. Spikes in demand are usually temporary. Please try again later.","status":"UNAVAILABLE"}}

What the library reported

Outcome
returned
Finish
{
  "raw": null,
  "source": "fullStream.finish.finishReason",
  "surface": "primary",
  "value": "error"
}
Text
Value
Octop
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 22,
  "output": 2,
  "reasoning": 0,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 24
}
Stream
{
  "chunks_seen": 8,
  "completed": false,
  "used": true
}
Error
Type
AI_StreamProviderError
Message
This model is currently experiencing high demand. Spikes in demand are usually temporary. Please try again later.
Category
api
Retry after
null
Stack top
ai/dist/index.js:8204
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 133.52532499999998,
  "error": {
    "category": "api",
    "message": "This model is currently experiencing high demand. Spikes in demand are usually temporary. Please try again later.",
    "retry_after": null,
    "stack_top": "ai/dist/index.js:8204",
    "type": "AI_StreamProviderError"
  },
  "finish": {
    "raw": null,
    "source": "fullStream.finish.finishReason",
    "surface": "primary",
    "value": "error"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "streamText",
    "language": "javascript",
    "name": "vercel-ai",
    "version": "7.0.153"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": 8,
    "completed": false,
    "used": true
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "Octop"
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 22,
    "output": 2,
    "reasoning": 0,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 24
  }
}

Fixture

derived gemini/stream.error-midstream

ProvenanceValue
Transforminject_error_event
Source fixturegemini/truncation.text-stream
RationaleThe provider reports an error after starting a successful HTTP stream.
Evidencehttps://github.com/googleapis/python-genai/blob/main/google/genai/_api_client.py

Reproduce

wiretruth serve gemini/stream.error-midstream

Plain-library snippet from the shim manifest.

createGoogleGenerativeAI({ baseURL: WIRETRUTH_BASE_URL_GEMINI + '/v1beta', apiKey })(model)

Upstream

released Issue · PR

Fixed in: @ai-sdk/google 4.0.99

@ai-sdk/google's stream chunk schema has no error field, so an {"error": ...} SSE event after some content parses as an empty chunk: no error part, and the stream finishes with 'other'. Google's python-genai raises on such a chunk. Fixed by #23459 in @ai-sdk/google 4.0.99; the derived Gemini fixture passes on ai 7.0.146 (no live in-stream Gemini error has been observed).

History

VersionGrade
7.0.153✓ PASS
7.0.146✓ PASS
7.0.142✗ WRONG