I’m building an app with the Responses API and streaming + response linking with previous_response_id. I have a simple test case: create response (store=true, stream=true) with a tool and ask for tool call. Assistant makes tool call. I reply with previous_response_id and a single item in input: the function call output.
Often, this test will work, in the sense that the assistant replies again. But sometimes (10-20% of times I run this test case?), I get a 400 Bad Request with “Previous response with id ‘resp_00cbcf1337e376a90068ed5890863c81948f149206f10e84ed’ not found” (for example).
You might think, okay, this is a race condition, you’re probably doing something dumb because you’re streaming or you’re making the followup request too fast. However: 1) I only initiate the 2nd request until after “response.completed” event has fired AND the SSE connection is closed. And 2) When this happens, the not-found response NEVER shows up in the Dashboard’s Logs (whereas if it doesn’t happen, it does show up).
My questions:
- Is this a known issue?
- Is there anything dumb I might be doing that would cause me to observe this behavior?
- Does anyone have a working, reliable integration going with Responses + response linking?
- Maybe using streaming in combination is making this unreliable? For instance, yesterday I ran into an issue where I couldn’t persist responses when using conversations (search for “Responses API: Response Not Stored in Conversation ID When Using Stream” – sorry I cannot link to it appparently.