✓ PASS

vercel-ai 7.0.153

truncation.text · anthropic

Back to results · Scenario

Requirements

IdLevelStatusEvidence
cause-is-truncationMUSTSATISFIEDfinish.value="length" (primary: result.finishReason); truth.finish="length"; error.category=null; structured.returned_as_success=false
text-reportedSHOULDSATISFIEDtext.value="Octopuses change colour by" (primary); truth.text="Octopuses change colour by"
usage-reportedSHOULDSATISFIEDusage.input=25 (primary); truth.usage.input=25; usage.output=16 (primary); truth.usage.output=16

What the provider sent

Finish
length
Raw finish
max_tokens
Text
Octopuses change colour by
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 25,
  "output": 16,
  "raw": {
    "input_tokens": 25,
    "output_tokens": 16,
    "output_tokens_details": {
      "thinking_tokens": 8
    }
  },
  "reasoning": 8,
  "total": 41
}
Stream completed
null
Error
null
Wire excerpt
status: 200
content-type: application/json
body (json):
{
  "id": "msg_01Aq9w938a90dw8q",
  "type": "message",
  "role": "assistant",
  "content": [
    {
      "type": "thinking",
      "thinking": "",
      "signature": "EqQBCgIYAhIM1gbcDa9GJwZA2b3hGgxBdjrkzLoky3dl1pkiMOYds..."
    },
    {
      "type": "text",
      "text": "Octopuses change colour by"
    }
  ],
  "model": "claude-sonnet-5-5",
  "stop_reason": "max_tokens",
  "stop_sequence": null,
  "stop_details": null,
  "usage": {
    "input_tokens": 25,
    "output_tokens": 16,
    "output_tokens_details": {
      "thinking_tokens": 8
    }
  }
}

What the library reported

Outcome
returned
Finish
{
  "raw": "max_tokens",
  "source": "result.finishReason",
  "surface": "primary",
  "value": "length"
}
Text
Value
Octopuses change colour by
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 25,
  "output": 16,
  "reasoning": 8,
  "surface": {
    "cached_input": "primary",
    "input": "primary",
    "output": "primary",
    "reasoning": "primary",
    "total": "primary"
  },
  "total": 41
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
null
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 123.54414699999995,
  "error": null,
  "finish": {
    "raw": "max_tokens",
    "source": "result.finishReason",
    "surface": "primary",
    "value": "length"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "generateText",
    "language": "javascript",
    "name": "vercel-ai",
    "version": "7.0.153"
  },
  "notes": [],
  "outcome": "returned",
  "stream": {
    "chunks_seen": null,
    "completed": null,
    "used": false
  },
  "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": 0,
    "input": 25,
    "output": 16,
    "reasoning": 8,
    "surface": {
      "cached_input": "primary",
      "input": "primary",
      "output": "primary",
      "reasoning": "primary",
      "total": "primary"
    },
    "total": 41
  }
}

Fixture

documented anthropic/truncation.text

ProvenanceValue
Sourcehttps://platform.claude.com/docs/en/build-with-claude/handling-stop-reasons#max-tokens
NotesDocumented shapes, not a recording. Message envelope and stop fields follow handling-stop-reasons; content blocks follow thinking/streaming and handle-tool-calls. Model changed to claude-sonnet-5-5; IDs and scenario text are filled in. Token counts are illustrative, filled in to include thinking within the requested output limit, not measured. ASSUMED composition: omitted thinking followed by a short text prefix at max_tokens; the docs do not show this exact small-budget response. Thinking is empty and the signature placeholder is copied literally from streaming#thinking-delta. The output_tokens_details.thinking_tokens breakdown follows thinking-steering.md (https://platform.claude.com/docs/en/build-with-claude/thinking-steering-and-cost#pricing); the thinking count of 8 is filled in, not measured.

Reproduce

wiretruth serve anthropic/truncation.text

Plain-library snippet from the shim manifest.

createAnthropic({ baseURL: WIRETRUTH_BASE_URL_ANTHROPIC + '/v1', apiKey })(model)

Upstream

No matching upstream report.

History

VersionGrade
7.0.153✓ PASS
7.0.146✓ PASS
7.0.142✓ PASS