~ LOSSY

tanstack-ai 1.4.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-incompleteMUSTNOT_OBSERVABLEstream.completed=null; 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": null,
  "input": null,
  "output": null,
  "reasoning": null,
  "surface": {
    "cached_input": "absent",
    "input": "absent",
    "output": "absent",
    "reasoning": "absent",
    "total": "absent"
  },
  "total": null
}
Stream
{
  "chunks_seen": 4,
  "completed": null,
  "used": true
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 114.49172800000002,
  "error": null,
  "finish": {
    "raw": null,
    "source": null,
    "surface": "absent",
    "value": null
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "chat",
    "language": "javascript",
    "name": "tanstack-ai",
    "version": "1.4.0"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": 4,
    "completed": null,
    "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": null,
    "input": null,
    "output": null,
    "reasoning": null,
    "surface": {
      "cached_input": "absent",
      "input": "absent",
      "output": "absent",
      "reasoning": "absent",
      "total": "absent"
    },
    "total": null
  }
}

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.

createGeminiChat(model, apiKey, { baseURL: WIRETRUTH_BASE_URL_GEMINI }); SDK appends /v1beta/models/<model>:streamGenerateContent or :generateContent.

Upstream

reported Issue

Fixed in: not specified

The Gemini adapter emits RUN_FINISHED only for a chunk with finishReason; a stream that ends without one stops with no terminal event and no error (@tanstack/ai-gemini 1.2.1). The Anthropic adapter got a terminal outcome for the same case in @tanstack/ai-anthropic 1.1.1 (https://github.com/TanStack/ai/pull/2042).

History

VersionGrade
1.4.0~ LOSSY
1.0.0~ LOSSY
0.71.0~ LOSSY