✓ PASS

pydantic-ai 2.61.0

stream.error-midstream · anthropic

Back to results · Scenario

Requirements

IdLevelStatusEvidence
error-reportedMUSTSATISFIEDoutcome=raised; error.category="api"; finish.value=null (absent); truth.finish="error"

What the provider sent

Finish
error
Raw finish
null
Text
Octopuses
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
Message
Overloaded
Status
null
Type
overloaded_error
Code
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: error
data: {"type": "error", "error": {"type": "overloaded_error", "message": "Overloaded"}}

What the library reported

Outcome
raised
Finish
{
  "raw": null,
  "source": null,
  "surface": "absent",
  "value": null
}
Text
Value
Octopuses
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 25,
  "output": 1,
  "reasoning": 0,
  "surface": {
    "cached_input": "raw",
    "input": "raw",
    "output": "raw",
    "reasoning": "raw",
    "total": "raw"
  },
  "total": 26
}
Stream
{
  "chunks_seen": 6,
  "completed": false,
  "used": true
}
Error
Type
pydantic_ai.exceptions.ModelOverloadedError
Message
status_code: 529, model_name: claude-sonnet-5-5, body: {'type': 'error', 'error': {'type': 'overloaded_error', 'message': 'Overloaded'}}
Category
api
Retry after
null
Stack top
pydantic_ai/models/anthropic.py:671
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 235.1437471807003,
  "error": {
    "category": "api",
    "message": "status_code: 529, model_name: claude-sonnet-5-5, body: {'type': 'error', 'error': {'type': 'overloaded_error', 'message': 'Overloaded'}}",
    "retry_after": null,
    "stack_top": "pydantic_ai/models/anthropic.py:671",
    "type": "pydantic_ai.exceptions.ModelOverloadedError"
  },
  "finish": {
    "raw": null,
    "source": null,
    "surface": "absent",
    "value": null
  },
  "format": "wiretruth.observation/v1",
  "library": {
    "api": "Agent.run_stream_events",
    "language": "python",
    "name": "pydantic-ai",
    "version": "2.61.0"
  },
  "notes": [],
  "outcome": "raised",
  "stream": {
    "chunks_seen": 6,
    "completed": false,
    "used": true
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "Octopuses "
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 25,
    "output": 1,
    "reasoning": 0,
    "surface": {
      "cached_input": "raw",
      "input": "raw",
      "output": "raw",
      "reasoning": "raw",
      "total": "raw"
    },
    "total": 26
  }
}

Fixture

derived anthropic/stream.error-midstream

ProvenanceValue
Transforminject_error_event
Source fixtureanthropic/truncation.text-stream
RationaleThe provider reports an error after starting a successful HTTP stream.
Evidencehttps://platform.claude.com/docs/en/build-with-claude/streaming#error-events

Reproduce

wiretruth serve anthropic/stream.error-midstream

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