✓ PASS

pydantic-ai 2.61.0

truncation.reasoning-only · anthropic

Back to results · Scenario

Requirements

IdLevelStatusEvidence
cause-is-truncationMUSTSATISFIEDfinish.value="length" (raw: ModelResponse.finish_reason); truth.finish="length"; error.category="truncation"; structured.returned_as_success=false
text-reportedMUSTSATISFIEDtext.value=null (absent); truth.text=null
usage-reportedSHOULDNOT_OBSERVABLEusage.output=64 (raw); truth.usage.output=64

What the provider sent

Finish
length
Raw finish
max_tokens
Text
null
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": 25,
  "output": 64,
  "raw": {
    "input_tokens": 25,
    "output_tokens": 64,
    "output_tokens_details": {
      "thinking_tokens": 64
    }
  },
  "reasoning": 64,
  "total": 89
}
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..."
    }
  ],
  "model": "claude-sonnet-5-5",
  "stop_reason": "max_tokens",
  "stop_sequence": null,
  "stop_details": null,
  "usage": {
    "input_tokens": 25,
    "output_tokens": 64,
    "output_tokens_details": {
      "thinking_tokens": 64
    }
  }
}

What the library reported

Outcome
raised
Finish
{
  "raw": "max_tokens",
  "source": "ModelResponse.finish_reason",
  "surface": "raw",
  "value": "length"
}
Text
Value
null
Surface
absent
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 25,
  "output": 64,
  "reasoning": 64,
  "surface": {
    "cached_input": "raw",
    "input": "raw",
    "output": "raw",
    "reasoning": "raw",
    "total": "raw"
  },
  "total": 89
}
Stream
{
  "chunks_seen": null,
  "completed": null,
  "used": false
}
Error
Type
pydantic_ai.exceptions.UnexpectedModelBehavior
Message
Model token limit (64) exceeded before any response was generated. Increase the `max_tokens` model setting, or simplify the prompt to result in a shorter response that will fit within the limit.
Category
truncation
Retry after
null
Stack top
pydantic_ai/_agent_graph.py:2495
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 280.19834589213133,
  "error": {
    "category": "truncation",
    "message": "Model token limit (64) exceeded before any response was generated. Increase the `max_tokens` model setting, or simplify the prompt to result in a shorter response that will fit within the limit.",
    "retry_after": null,
    "stack_top": "pydantic_ai/_agent_graph.py:2495",
    "type": "pydantic_ai.exceptions.UnexpectedModelBehavior"
  },
  "finish": {
    "raw": "max_tokens",
    "source": "ModelResponse.finish_reason",
    "surface": "raw",
    "value": "length"
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "Agent.run",
    "language": "python",
    "name": "pydantic-ai",
    "version": "2.61.0"
  },
  "notes": [],
  "outcome": "raised",
  "stream": {
    "chunks_seen": null,
    "completed": null,
    "used": false
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "absent",
    "value": null
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 25,
    "output": 64,
    "reasoning": 64,
    "surface": {
      "cached_input": "raw",
      "input": "raw",
      "output": "raw",
      "reasoning": "raw",
      "total": "raw"
    },
    "total": 89
  }
}

Fixture

documented anthropic/truncation.reasoning-only

ProvenanceValue
Sourcehttps://platform.claude.com/docs/en/build-with-claude/thinking#controlling-thinking-display
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 max_tokens envelope with exactly one omitted thinking block and no text. Empty thinking plus signature follows omitted display; signature is the literal streaming placeholder. The docs do not print this complete truncated response. 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 64 is filled in, not measured.

Reproduce

wiretruth serve anthropic/truncation.reasoning-only

Plain-library snippet from the shim manifest.

AnthropicModel(model, provider=AnthropicProvider(base_url=WIRETRUTH_BASE_URL_ANTHROPIC, api_key=WIRETRUTH_API_KEY)); host root

Upstream

No matching upstream report.

History

VersionGrade
2.61.0✓ PASS
2.56.0✓ PASS