✓ PASS

vercel-ai 7.0.153

stream.missing-finish · gemini

Back to results · Scenario

Requirements

IdLevelStatusEvidence
no-normal-stopMUSTSATISFIEDoutcome=returned; finish.value="none" (primary: fullStream.finish.finishReason); truth.finish="none"; forbidden finish="stop"
stream-incompleteMUSTSATISFIEDstream.completed=false; outcome=returned; truth.stream_completed=false

What the provider sent

Finish
none
Raw finish
null
Text
Octopuses are the ultimate masters of disguise, utilizing a
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 22,
  "output": 12,
  "raw": {
    "candidatesTokenCount": 12,
    "promptTokenCount": 22,
    "promptTokensDetails": [
      {
        "modality": "TEXT",
        "tokenCount": 22
      }
    ],
    "serviceTier": "standard",
    "totalTokenCount": 34
  },
  "reasoning": null,
  "total": 34
}
Stream completed
false
Error
null
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: {"candidates": [{"content": {"parts": [{"text": "uses are the ultimate masters of disguise, utilizing a"}],"role": "model"},"index": 0}],"usageMetadata": {"promptTokenCount": 22,"candidatesTokenCount": 12,"totalTokenCount": 34,"promptTokensDetails": [{"modality": "TEXT","tokenCount": 22}],"serviceTier": "standard"},"modelVersion": "gemini-3.5-flash-lite","responseId": "pgTOaonbKMuV_uMPvK7d4AE"}

What the library reported

Outcome
returned
Finish
{
  "raw": null,
  "source": "fullStream.finish.finishReason",
  "surface": "primary",
  "value": "none"
}
Text
Value
Octopuses are the ultimate masters of disguise, utilizing a
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 22,
  "output": 12,
  "reasoning": 0,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 34
}
Stream
{
  "chunks_seen": 8,
  "completed": false,
  "used": true
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 148.805427,
  "error": null,
  "finish": {
    "raw": null,
    "source": "fullStream.finish.finishReason",
    "surface": "primary",
    "value": "none"
  },
  "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": "Octopuses are the ultimate masters of disguise, utilizing a"
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 22,
    "output": 12,
    "reasoning": 0,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 34
  }
}

Fixture

derived gemini/stream.missing-finish

ProvenanceValue
Transformstrip_finish
Source fixturegemini/truncation.text-stream
RationaleThe stream ends cleanly without its finish signal.
Evidencehttps://github.com/pydantic/pydantic-ai/issues/6610

Reproduce

wiretruth serve gemini/stream.missing-finish

Plain-library snippet from the shim manifest.

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

Upstream

released Issue · PR

Fixed in: @ai-sdk/openai 4.0.100, @ai-sdk/anthropic 4.0.86, @ai-sdk/google 4.0.103 (ai 7.0.149)

A stream that ends cleanly before the provider's terminal event yields a normal finish part with finishReason 'other' and no error: the @ai-sdk/openai (Chat and Responses), @ai-sdk/anthropic and @ai-sdk/google adapters start from 'other' and emit it from flush(). vercel/ai#19165 fixed the same case in @ai-sdk/openai-compatible (an InvalidResponseDataError, then finish 'error'), so ollama-openai passes. Fixed by #23778, which adds an 'interrupted' finish reason in ai 7.0.149, and #23814, which makes the four adapters emit it when the stream ends without the provider's completion signal. The shim maps 'interrupted' to finish none and stream.completed false; all four cells pass on ai 7.0.153.

History

VersionGrade
7.0.153✓ PASS
7.0.146✗ WRONG
7.0.142✗ WRONG