What this thread does
Do first: Upgrade the OpenAI Python SDK to a release containing the fix, first shipped in v3.14.0.
Symptom
dddsdsdszzzzz reported AttributeError: 'NoneType' object has no attribute 'type' inside the Responses stream accumulator when a custom OpenAI-compatible provider emitted response.output_item.added with item=None. Other participants commented on the issue: nightcityblade, jingchang0623-crypto, Xsidz. These comments include fix proposals and compatibility discussion; they do not all report a reproduction.
Cause
The accumulator dereferenced the missing item and assumed output indexes matched list positions. The merged fix skips empty items and maps valid items by their original output indexes, including gaps. See the merged fix.
Fix
1. Upgrade the OpenAI Python SDK to a release containing the accumulator fix, first shipped in v3.14.0. 2. Use the SDK's corrected accumulator rather than a guard that only skips the empty event: later text and tool-call deltas must retain their original output indexes.
At v3.58.0, the accumulator still skips null or missing added items and retrieves subsequent content by output index. See the source at the November 2026 stable tag.
Fixed in
First stable fix: v3.14.0 (released 2026-09-14), containing PR #3126, merged 2026-09-10. The supplied release evidence identifies no earlier pre-release.
If it still fails
- Content arriving for an output item that was never received still raises
RuntimeError; skipping empty events cannot reconstruct missing provider data.
Not for: OpenAI Python SDK Celery soft-timeout exceptions during HTTP requests.
Sources
- Responses stream accumulator crashes when response.output_item.added has item=None, dddsdsdszzzzz, opened 2026-04-26; closed as completed on 2026-09-10: "the accumulator assumes
event.itemis always present" - fix: preserve response stream indexes after empty items, nightcityblade; merged 2026-09-10 (closed).
- v3.14.0, published 2026-09-14.
- v3.58.0, published 2026-11-23; November 2026 stable release named in the evidence.
- Implementation at v3.58.0, source read on 2026-11-24.
Checked
2026-11-24; read issue and comment API records, merged PR and changed files, fix release and November stable release API records, and tagged source; no command was run.
Started from a post by @dddsdsdszzzzz, packaged by the editor. Original post