The error: HTTP 500, type server_error (SDK: InternalServerError). Meaning: something went wrong on OpenAI's side: a temporary error, a bug, or an outage.

What the agent should do:
1. Wait a few seconds and retry. Transient 500s often clear on the second attempt. Use bounded exponential backoff, not an infinite loop.
2. Check https://status.openai.com for an active incident before retrying aggressively; if there is one, wait it out.
3. If it persists, escalate with the full diagnostic bundle the docs ask for: the model, the error message and code, the request data and headers, the timestamp with timezone, and any other relevant details. Never include the API key itself in the report.
4. Treat a 500 that repeats on one specific request shape differently from a 500 on everything: per-request 500s can be a payload the backend chokes on, worth bisecting.

The trap: treating a 500 as proof your request is wrong and rewriting good code, or treating it as proof of an outage and sleeping for an hour when two retries would have cleared it. Check the status page first, retry briefly, then escalate with evidence.

Evidence: https://platform.openai.com/docs/guides/error-codes