✓ PASS

pydantic-ai 2.61.0

stream.error-midstream · openai-responses

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 change
Tool calls
[]
Usage
{
  "alternatives": {},
  "cached_input": null,
  "input": null,
  "output": null,
  "raw": null,
  "reasoning": null,
  "total": null
}
Stream completed
false
Error
Message
The server had an error while processing your request. Sorry about that!
Status
null
Type
null
Code
server_error
Wire excerpt
status: 200
content-type: text/event-stream; charset=utf-8
body (sse):
event: response.created
data: {"type":"response.created","response":{"id":"resp_025c23fff6653590006acbfc0086cc87d18124e70e8d3ff838","object":"response","created_at":1791753216,"status":"in_progress","access_programs":null,"background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":16,"max_tool_calls":null,"model":"gpt-6-luna","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"none","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0}


event: response.in_progress
data: {"type":"response.in_progress","response":{"id":"resp_025c23fff6653590006acbfc0086cc87d18124e70e8d3ff838","object":"response","created_at":1791753216,"status":"in_progress","access_programs":null,"background":false,"completed_at":null,"error":null,"frequency_penalty":0.0,"incomplete_details":null,"instructions":null,"max_output_tokens":16,"max_tool_calls":null,"model":"gpt-6-luna","moderation":null,"output":[],"parallel_tool_calls":true,"presence_penalty":0.0,"previous_response_id":null,"prompt_cache_key":null,"prompt_cache_retention":"24h","reasoning":{"context":"all_turns","effort":"none","mode":"standard","summary":null},"safety_identifier":null,"service_tier":"auto","store":true,"temperature":1.0,"text":{"format":{"type":"text"},"verbosity":"medium"},"tool_choice":"auto","tool_usage":{"image_gen":{"input_tokens":0,"input_tokens_details":{"image_tokens":0,"text_tokens":0},"output_tokens":0,"output_tokens_details":{"image_tokens":0,"text_tokens":0},"total_tokens":0},"web_search":{"num_requests":0}},"tools":[],"top_logprobs":0,"top_p":0.98,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1}


event: response.output_item.added
data: {"type":"response.output_item.added","item":{"id":"msg_025c23fff6653590006acbfc016d8087d18e46405588162435","type":"message","status":"in_progress","content":[],"phase":"final_answer","role":"assistant"},"output_index":0,"sequence_number":2}


event: response.content_part.added
data: {"type":"response.content_part.added","content_index":0,"item_id":"msg_025c23fff6653590006acbfc016d8087d18e46405588162435","output_index":0,"part":{"type":"output_text","annotations":[],"logprobs":[],"text":""},"sequence_number":3}


event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":"Oct","item_id":"msg_025c23fff6653590006acbfc016d8087d18e46405588162435","logprobs":[],"obfuscation":"JJEbJBKhHOigL","output_index":0,"sequence_number":4}


event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":"op","item_id":"msg_025c23fff6653590006acbfc016d8087d18e46405588162435","logprobs":[],"obfuscation":"rCPO5tGFW8ghsz","output_index":0,"sequence_number":5}


event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":"uses","item_id":"msg_025c23fff6653590006acbfc016d8087d18e46405588162435","logprobs":[],"obfuscation":"byausMiYWM8M","output_index":0,"sequence_number":6}


event: response.output_text.delta
data: {"type":"response.output_text.delta","content_index":0,"delta":" change","item_id":"msg_025c23fff6653590006acbfc016d8087d18e46405588162435","logprobs":[],"obfuscation":"lE22JEr0R","output_index":0,"sequence_number":7}


event: error
data: {"type":"error","code":"server_error","message":"The server had an error while processing your request. Sorry about that!","param":null,"sequence_number":8}

What the library reported

Outcome
raised
Finish
{
  "raw": null,
  "source": null,
  "surface": "absent",
  "value": null
}
Text
Value
Octopuses change
Surface
primary
Tool calls
[]
Usage
{
  "cached_input": 0,
  "input": 0,
  "output": 0,
  "reasoning": 0,
  "surface": {
    "cached_input": "raw",
    "input": "raw",
    "output": "raw",
    "reasoning": "raw",
    "total": "raw"
  },
  "total": 0
}
Stream
{
  "chunks_seen": 5,
  "completed": false,
  "used": true
}
Error
Type
pydantic_ai.exceptions.ModelServerError
Message
status_code: 500, model_name: gpt-6-luna, body: {'code': 'server_error', 'message': 'The server had an error while processing your request. Sorry about that!'}
Category
api
Retry after
null
Stack top
pydantic_ai/models/openai.py:6111
Unsupported reason
null
Full observation JSON
{
  "elapsed_ms": 387.31628376990557,
  "error": {
    "category": "api",
    "message": "status_code: 500, model_name: gpt-6-luna, body: {'code': 'server_error', 'message': 'The server had an error while processing your request. Sorry about that!'}",
    "retry_after": null,
    "stack_top": "pydantic_ai/models/openai.py:6111",
    "type": "pydantic_ai.exceptions.ModelServerError"
  },
  "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": 5,
    "completed": false,
    "used": true
  },
  "structured": {
    "attempted": false,
    "returned_as_success": false,
    "value": null
  },
  "text": {
    "surface": "primary",
    "value": "Octopuses change"
  },
  "tool_calls": [],
  "unsupported_reason": null,
  "usage": {
    "cached_input": 0,
    "input": 0,
    "output": 0,
    "reasoning": 0,
    "surface": {
      "cached_input": "raw",
      "input": "raw",
      "output": "raw",
      "reasoning": "raw",
      "total": "raw"
    },
    "total": 0
  }
}

Fixture

derived openai-responses/stream.error-midstream

ProvenanceValue
Transforminject_error_event
Source fixtureopenai-responses/truncation.text-stream
RationaleThe provider reports an error after starting a successful HTTP stream.
Evidencehttps://github.com/pydantic/pydantic-ai/pull/9321

Reproduce

wiretruth serve openai-responses/stream.error-midstream

Plain-library snippet from the shim manifest.

OpenAIResponsesModel(model, provider=OpenAIProvider(base_url=WIRETRUTH_BASE_URL_OPENAI_RESPONSES, api_key=WIRETRUTH_API_KEY))

Upstream

No matching upstream report.

History

VersionGrade
2.61.0✓ PASS
2.56.0✓ PASS