✗ WRONG

pydantic-ai 2.61.0

stream.missing-finish · gemini

Back to results · Scenario

Requirements

IdLevelStatusEvidence
no-normal-stopMUSTSATISFIEDoutcome=returned; finish.value=null (absent); truth.finish="none"; forbidden finish="stop"
stream-incompleteMUSTCONTRADICTEDstream.completed=true; 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": null,
  "surface": "absent",
  "value": null
}
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": 5,
  "completed": true,
  "used": true
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 203.6975957453251,
  "error": null,
  "finish": {
    "raw": null,
    "source": null,
    "surface": "absent",
    "value": null
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "Agent.run_stream_events",
    "language": "python",
    "name": "pydantic-ai",
    "version": "2.61.0"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": 5,
    "completed": true,
    "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.

GoogleModel(model, provider=GoogleProvider(base_url=WIRETRUTH_BASE_URL_GEMINI, api_key=WIRETRUTH_API_KEY)); host root

Upstream

confirmed Issue

Fixed in: not specified

A stream that ends cleanly before the provider's terminal event finishes with ModelResponse.state 'complete' and finish_reason None, although the docs define 'incomplete' as a streamed response stopped before completion. Responses marks the response incomplete, but _ContinuationStreamedResponse.get() replaces it with complete once iteration ends; the Anthropic and Google adapters never set incomplete. The Chat Completions case is #6610 (documented-behavior). pydantic-ai's triage bot reproduced all three adapters and labelled the issue p:2-high and needs-maintainer-discussion (2026-10-25): the open question is whether a stream that ends before the provider's terminal event should report state 'incomplete'.

History

VersionGrade
2.61.0✗ WRONG
2.56.0✗ WRONG