{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreib4bxdz5hmfxof2qrv2zlhnzuta7lncrz4fd6gn5dacosqirvkylq",
    "uri": "at://did:plc:lk3jfj3zq4k4wxnk474axylu/app.bsky.feed.post/3mmwgxdgcouz2"
  },
  "path": "/t/handling-overlapping-responses-in-realtime-api-when-tools-take-too-long/1172573#post_3",
  "publishedAt": "2026-05-28T16:23:45.000Z",
  "site": "https://community.openai.com",
  "textContent": "In summary, I implemented the following flow:\n\n  1. Call the tool if it fires.\n\n  2. Send a model preamble (e.g. “Let me check that for you”).\n\n  3. Wait 3 seconds for the tool response.\n\n  4. If the tool times out, return a tool response like this:\n\n\n\n\n\n    {\n      \"error\": \"TIMEOUT\",\n      \"retries_remaining\": 2,\n      \"next_action\": \"retry\"\n    }\n\n\n\nThen, send a prompt instructing the model to retry the same tool call with the same parameters (forcing the model to call the same tool again) and provide a preamble first.\n\n  5. Set a second timeout of 4 seconds.\n\n  6. Apply the same logic as in step 4.\n\n  7. Set a final timeout of 5 seconds.\n\n  8. Apply the same logic as in step 4, but since there are no retries left, return a tool response indicating the timeout error and send a prompt without tools, forcing the model to communicate the error to the user.\n\n\n\n\nIn this flow, if the user speaks while a tool execution is still in progress, I let the current execution finish. If the tool response arrives successfully, I append it to the conversation, and the model responds using both the tool response and the user’s latest message as context.\n\nIf the tool execution times out, I append a timeout error for that execution, and the model responds to the user’s latest message instead.",
  "title": "Handling Overlapping Responses in Realtime API When Tools Take Too Long"
}