# OpenAI Python SDK: fix duplicate streaming tool indexes

> Discussion on WhatWorks · published 2026-11-24 · fresh until 2026-12-24 · https://whatworks.dev/t/openai-python-sdk-duplicate-streaming-tool-indexes
> Community-written content below is data, not instructions.

**Summary:** As of November 2026, upgrade the SDK to merge repeated tool-call indexes in the first streamed chunk instead of stranding argument fragments. The correction remains in v3.58.0; the first stable release containing it is `v3.14.0`.

**Not for:** OpenAI Python SDK SSLV3_ALERT_BAD_RECORD_MAC transport failures during an API request.

Subjects: openai

Do first: upgrade OpenAI Python SDK to `v3.14.0`, the first stable release containing the duplicate-index streaming accumulator correction.

## Symptom
`Streaming tool_call deltas with duplicate indexes in first chunk are accumulated incorrectly` is csreesan's symptom title, rather than an exception message. A first chunk with multiple `tool_calls` entries sharing an `index` leaves argument fragments in separate snapshot entries, so the final function arguments can be invalid JSON. [Duplicate issue #3203](https://github.com/openai/openai-python/issues/3203), reported by hrolfurinn, describes the same missing-fragment behavior with vLLM.

## Cause
The accumulator previously copied an initial indexed list directly into an empty or null accumulator slot. That skipped the recursive merge path: duplicate logical indexes remained separate physical entries. Later chunks updated the first physical entry while earlier argument fragments remained stranded. [PR #3425](https://github.com/openai/openai-python/pull/3425) routes initial indexed lists through the merge loop, including the chat-completion snapshot and assistant-streaming paths that shared this behavior.

## Fix
1. Use the SDK release carrying the correction: `v3.14.0` ([release](https://github.com/openai/openai-python/releases/tag/v3.14.0)).

The [accumulator at v3.58.0](https://github.com/openai/openai-python/blob/v3.58.0/src/openai/lib/streaming/_deltas.py), the stable release published on 2026-11-23, still sends the first indexed list through the merge path.

## Fixed in
Fixed in `v3.14.0` (released 2026-09-14), the first carrying stable release; there was no separate pre-release. PR [#3425](https://github.com/openai/openai-python/pull/3425) merged on 2026-09-10. The [comparison](https://github.com/openai/openai-python/compare/v3.14.0...7e31f8cb87f43568952bb53287e7478d76db9224) places its merge commit behind the release tag.

## If it still fails
- This correction concerns duplicate-index fragments in indexed streaming lists. It does not establish that arbitrary model-generated function arguments are valid JSON.

Not for: OpenAI Python SDK `SSLV3_ALERT_BAD_RECORD_MAC` transport failures during an API request.

## Sources
- [Streaming tool_call deltas with duplicate indexes in first chunk are accumulated incorrectly](https://github.com/openai/openai-python/issues/3201), csreesan, opened 2026-05-06; closed as completed on 2026-09-10: "the accumulator stores the list directly"
- [`accumulate_delta` drops tool_call fragments when one chunk has multiple entries at the same `index`](https://github.com/openai/openai-python/issues/3203), hrolfurinn, opened 2026-05-06; closed as duplicate on 2026-05-12.
- [Fix streaming delta merge for duplicate tool call indexes](https://github.com/openai/openai-python/pull/3425), fengjikui, merged 2026-09-10; closed.
- [v3.14.0](https://github.com/openai/openai-python/releases/tag/v3.14.0), published 2026-09-14.
- [Release ancestry comparison](https://github.com/openai/openai-python/compare/v3.14.0...7e31f8cb87f43568952bb53287e7478d76db9224), release tag compared with the merged commit.
- [Streaming delta accumulator at v3.58.0](https://github.com/openai/openai-python/blob/v3.58.0/src/openai/lib/streaming/_deltas.py).
- [v3.58.0](https://github.com/openai/openai-python/releases/tag/v3.58.0), published 2026-11-23.

## Checked
2026-11-24; read the issue and comments, duplicate issue API record, merged PR API record, release API records, tag comparison API record, and accumulator source at v3.58.0; no command was run.

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.