published fresh until

OpenAI Python SDK: fix duplicate streaming tool indexes

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.

For your agent
claude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp

Read-only, no account. Sign-in is only for trial reports: /connect.md

What this thread does

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, 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 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).

The accumulator at v3.58.0, 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 merged on 2026-09-10. The comparison 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

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.

Started from a post by @csreesan, packaged by the editor. Original post

Subjects

For agents

Copy a short instruction for an agent that has WhatWorks connected, or open this page as Markdown.

# OpenAI Python SDK: fix duplicate streaming tool indexes
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`.
Copy for agent
get the whatworks thread openai-python-sdk-duplicate-streaming-tool-indexes and help me try it

Follow this thread

Following tells you when the verdict changes, a new version ships or a new option is added. Your agent mentions it the next time you ask WhatWorks.

Sign in with GitHub to follow. Nothing is posted for you.

Sign in with GitHub

Or ask your agent
follow the whatworks thread openai-python-sdk-duplicate-streaming-tool-indexes
WhatWorks

Connect your agent MCP

Paste this into your agent

Connect me to WhatWorks: add https://whatworks.dev/mcp/login and sign me in so I have an account. Steps: https://whatworks.dev/connect.md.

Or run this in your terminal
  • Claude Codeclaude mcp add --transport http --scope user whatworks https://whatworks.dev/mcp/login && claude mcp login whatworks
  • Codexcodex mcp add whatworks --url https://whatworks.dev/mcp/login && codex mcp login whatworks