✓ PASS

vercel-ai 7.0.153

stream.missing-finish · openai-chat

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
A traditional Japanese breakfast is built around rice, soup, and a
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": null,
  "output": null,
  "raw": null,
  "reasoning": null,
  "total": null
}
Stream completed
false
Error
null
Wire excerpt
status: 200
content-type: text/event-stream; charset=utf-8
body (sse):
data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"role":"assistant","content":"","refusal":null},"finish_reason":null}],"usage":null,"obfuscation":""}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":"A"},"finish_reason":null}],"usage":null,"obfuscation":"b"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" traditional"},"finish_reason":null}],"usage":null,"obfuscation":"d52OTd"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" Japanese"},"finish_reason":null}],"usage":null,"obfuscation":"w1dZTLipP"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" breakfast"},"finish_reason":null}],"usage":null,"obfuscation":"MWjy8UlZ"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" is"},"finish_reason":null}],"usage":null,"obfuscation":"icVTZPFYRG5lFwL"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" built"},"finish_reason":null}],"usage":null,"obfuscation":"AYTZtVaq9EDe"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" around"},"finish_reason":null}],"usage":null,"obfuscation":"kMyBiZ4fH9u"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" rice"},"finish_reason":null}],"usage":null,"obfuscation":"ipQ7qmg7ME8qn"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"F"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" soup"},"finish_reason":null}],"usage":null,"obfuscation":"koHOHl6FSzjzv"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":","},"finish_reason":null}],"usage":null,"obfuscation":"c"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" and"},"finish_reason":null}],"usage":null,"obfuscation":"zgb5ipuHgdlxrv"}


data: {"id":"chatcmpl-EXmWZAYmW8gL0ntPfYzZYrbv99Dcb","object":"chat.completion.chunk","created":1791720059,"model":"gpt-6-luna","service_tier":"default","system_fingerprint":null,"choices":[{"index":0,"delta":{"content":" a"},"finish_reason":null}],"usage":null,"obfuscation":""}

What the library reported

Outcome
returned
Finish
{
  "raw": null,
  "source": "fullStream.finish.finishReason",
  "surface": "primary",
  "value": "none"
}
Text
Value
A traditional Japanese breakfast is built around rice, soup, and 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": 19,
  "completed": false,
  "used": true
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 194.79704800000002,
  "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": 19,
    "completed": false,
    "used": true
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "A traditional Japanese breakfast is built around rice, soup, and 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 openai-chat/stream.missing-finish

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

Reproduce

wiretruth serve openai-chat/stream.missing-finish

Plain-library snippet from the shim manifest.

createOpenAI({ baseURL: WIRETRUTH_BASE_URL_OPENAI_CHAT, apiKey }).chat(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