Issue Description
I am experiencing an issue where streaming responses from the Responses API get stuck when processing with multiple file attachments. The stream stops after emitting a few events and never completes.
I tried to do it without the streaming hoping to get a responses perhaps with some errors or check the header for any useful information, but when streaming is not enabled, I don’t get any responses at all, the http client just waits till it times out.
Sometimes if I retry a couple of times, it works, so it happens like 4 out of 5 times, the more the attachments involved, the higher the chances, with no attachment or one or two, it always works;
During the stream, I am able to get the response ID resp_xxx in the response.created
event, when I try to look up the response ID in the open AI logs or try to fetch it via the API, it doesn’t exist
Request structure
{
"input": [
{
"role": "user",
"type": "message",
"content": "Process the uploaded attachment(s) and generate content based on the following description:"
},
{
"role": "user",
"type": "message",
"content": [
{
"type": "input_text",
"text": "worksheet attachments with the file extension `pdf`."
},
{
"type": "input_file",
"file_id": "file-ABC123..."
},
{
"type": "input_file",
"file_id": "file-DEF456..."
},
{
"type": "input_file",
"file_id": "file-GHI789..."
},
{
"type": "input_file",
"file_id": "file-JKL012..."
}
]
},
{
"role": "user",
"type": "message",
"content": [
{
"type": "input_text",
"text": "curriculum document attachments with the file extension `pdf`."
},
{
"type": "input_file",
"file_id": "file-MNO345..."
},
{
"type": "input_file",
"file_id": "file-PQR678..."
}
]
}
],
"model": "gpt-4o",
"instructions": "# Sample Instructions\n\nGenerate content based on uploaded documents...",
"truncation": "auto",
"tool_choice": "required",
"tools": [
{
"type": "function",
"name": "submit_assessment",
"description": "Submit generated content for review",
"parameters": {
"type": "object",
"properties": {
"assessment": {
"type": "object",
"properties": {
"title": {"type": "string"},
"description": {"type": "string"},
"learningObjectives": {
"type": "array",
"items": {"type": "string"}
},
"markingScheme": {"type": "string"},
"gradingType": {"type": "string"},
"maximumMarks": {"type": "integer", "nullable": true}
},
"required": ["title", "description", "learningObjectives", "markingScheme", "gradingType", "maximumMarks"],
"additionalProperties": false
}
},
"required": ["assessment"],
"additionalProperties": false
},
"strict": true
},
{
"type": "file_search",
"vector_store_ids": ["vs_1234567890abcdef..."]
},
{
"type": "code_interpreter",
"container": {
"type": "auto",
"file_ids": [
"file-ABC123...",
"file-DEF456...",
"file-GHI789..."
]
}
}
],
"stream": true,
"conversation": "conv_1234567890abcdef..."
}
This is really frustrating as I have clients waiting for me to release some features for them, I cannot proceed with this, with the erractic nature of the responses API
Environment Details
- API: Responses API v1
- Model gpt-4o, gpt-5
- File Count: 3+ attachments (PDFs, DOCX, PPTX)
- Tools: file_search + code_interpreter + custom function
- Success Rate: ~20% (1 out of 5 attempts)
- Environment: Staging (Kubernetes)
Note that if non pdf and non image files are present, they will be attached to the vector store and added via the file_search and also to the code_interpreter