I’m not sure if this has already been reported, but I’ve encountered this issue multiple times when using webhooks.
When a request takes slightly longer to process, the webhook sometimes returns an empty result, even though I explicitly filter for the response.completed event type.
For example:
if event.type == "response.completed":
response_id = event.data.id
response = openai_client.responses.retrieve(response_id)
metadata = response.metadata or {}
output_text = response.output_text
In these cases, response.output_text is empty, despite the response being marked as completed.
What could be causing this, and is there a recommended way to handle or avoid it?