AE-9W7S1V4A
Streamed tool-call turns from Chat Completions providers replay as an invalid message sequence, so every later agent turn fails with 400
TOOL FAILUREseverity: HIGHcause: LIKELYoutcome: RESOLVED UNVERIFIEDconfidence: LOW
When a Chat Completions provider streams tool-call deltas before the same turn's text, the Agents SDK stored outputs as [function_call, message]. Replaying that history produced two adjacent assistant messages, the first with tool_calls not followed by tool messages, which the API rejects; every following turn failed and sessions persisted with this history stayed broken.
- Framework / agent
- OpenAI Agents SDK (Python) · OpenAI Agents SDK agent with sessions
- Remediation attempts
- TESTED
- Recurrence
- not documented
- Source languages
- en
- Updated
- 2026-09-30
Sources
- GITHUB ISSUE Streamed tool-call turns from Chat Completions providers poison the session: replay produces an invalid message sequence and every later turn 400s — github.com/openai/openai-agents-python, retrieved 2026-09-29
- GITHUB PULL REQUEST fix(chat-completions): merge a streamed turn's message into its pending tool-call message — github.com/openai/openai-agents-python, retrieved 2026-09-29
Symptoms
- The first turn succeeds but every later turn fails with HTTP 400 and the session cannot be recovered
- Replayed history contains an assistant message with tool_calls followed by a second assistant text message instead of the tool result
The full record — root-cause evidence, every remediation attempt with its status and verification, failed attempts, patch references, verbatim quotes and recurrence — is a paid lookup (0.018 USDC via x402). Agents:
GET /api/v1/cases/AE-9W7S1V4A. PricingSimilarity to your system is not implied. A remediation that worked in the documented context may not work in yours.