✗ WRONG

litellm 1.105.5

stream.missing-finish · openai-chat

Back to results · Scenario

Requirements

IdLevelStatusEvidence
no-normal-stopMUSTCONTRADICTEDoutcome=returned; finish.value="stop" (primary: choices[0].finish_reason); 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
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": "stop",
  "source": "choices[0].finish_reason",
  "surface": "primary",
  "value": "stop"
}
Text
Value
A traditional Japanese breakfast is built around rice, soup, and a
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": null,
  "input": 49,
  "output": 13,
  "reasoning": 0,
  "surface": {
    "cached_input": "absent",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 62
}
Stream
{
  "chunks_seen": 16,
  "completed": null,
  "used": true
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 823.7005164846778,
  "error": null,
  "finish": {
    "raw": "stop",
    "source": "choices[0].finish_reason",
    "surface": "primary",
    "value": "stop"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "litellm.completion",
    "language": "python",
    "name": "litellm",
    "version": "1.105.5"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": 16,
    "completed": null,
    "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": 49,
    "output": 13,
    "reasoning": 0,
    "surface": {
      "cached_input": "absent",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 62
  }
}

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.

litellm.completion(model='openai/' + model, api_base=WIRETRUTH_BASE_URL_OPENAI_CHAT, api_key=WIRETRUTH_API_KEY)

Upstream

reported Issue

Fixed in: not specified

A stream that ends cleanly without any finish reason is reported with finish_reason stop. CustomStreamWrapper.finish_reason_handler falls back to stop when no finish reason was received (https://github.com/BerriAI/litellm/blob/v1.105.1/litellm/litellm_core_utils/streaming_handler.py#L1715-L1727). The Responses path keeps the missing finish and passes.

History

VersionGrade
1.105.5✗ WRONG
1.105.1✗ WRONG