✓ PASS

vercel-ai 7.0.153

stream.missing-finish · anthropic

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 change colour by
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 25,
  "output": 1,
  "raw": {
    "input_tokens": 25,
    "output_tokens": 1
  },
  "reasoning": null,
  "total": 26
}
Stream completed
false
Error
null
Wire excerpt
status: 200
content-type: text/event-stream
body (sse):
event: message_start
data: {"type": "message_start", "message": {"id": "msg_01Aq9w938a90dw8q", "type": "message", "role": "assistant", "content": [], "model": "claude-sonnet-5-5", "stop_reason": null, "stop_sequence": null, "usage": {"input_tokens": 25, "output_tokens": 1}}}


event: content_block_start
data: {"type": "content_block_start", "index": 0, "content_block": {"type": "thinking", "thinking": "", "signature": ""}}


event: ping
data: {"type": "ping"}


event: content_block_delta
data: {"type": "content_block_delta", "index": 0, "delta": {"type": "thinking_delta", "thinking": ""}}


event: content_block_delta
data: {"type": "content_block_delta", "index": 0, "delta": {"type": "signature_delta", "signature": "EqQBCgIYAhIM1gbcDa9GJwZA2b3hGgxBdjrkzLoky3dl1pkiMOYds..."}}


event: content_block_stop
data: {"type": "content_block_stop", "index": 0}


event: content_block_start
data: {"type": "content_block_start", "index": 1, "content_block": {"type": "text", "text": ""}}


event: content_block_delta
data: {"type": "content_block_delta", "index": 1, "delta": {"type": "text_delta", "text": "Octopuses "}}


event: content_block_delta
data: {"type": "content_block_delta", "index": 1, "delta": {"type": "text_delta", "text": "change colour by"}}


event: content_block_stop
data: {"type": "content_block_stop", "index": 1}

What the library reported

Outcome
returned
Finish
{
  "raw": null,
  "source": "fullStream.finish.finishReason",
  "surface": "primary",
  "value": "none"
}
Text
Value
Octopuses change colour by
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": 13,
  "completed": false,
  "used": true
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 139.44907800000004,
  "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": 13,
    "completed": false,
    "used": true
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "Octopuses change colour by"
  },
  "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 anthropic/stream.missing-finish

ProvenanceValue
Transformstrip_finish
Source fixtureanthropic/truncation.text-stream
RationaleThe stream ends cleanly without its finish signal.
Evidencehttps://platform.claude.com/docs/en/build-with-claude/streaming#event-types

Reproduce

wiretruth serve anthropic/stream.missing-finish

Plain-library snippet from the shim manifest.

createAnthropic({ baseURL: WIRETRUTH_BASE_URL_ANTHROPIC + '/v1', 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