agents/apiTHE ENCYCLOPEDIA
Production

Agents API troubleshooting: symptoms, checks & recovery

Diagnose access failures, pending tools, missing output, disconnected environments, and duplicate work.

Capture IDs
Identify failure layer
Inspect current state
Fix cause
Verify outcome

Identify the failing layer first

Capture the request ID when available, session ID, turn ID, event type, time, and sanitized error. Distinguish an HTTP/API rejection, a browser stream failure, a required action, a tool error, and an environment problem. Never include keys, signing secrets, or unrestricted customer payloads in a public bug report.

Use the symptom table

These checks identify likely causes; the actual API error and current resource state take precedence. Avoid retrying a rejected request indefinitely.

Use the symptom table
SymptomCheckNext action
401 or permission denialKey, project, permission scope, model/API accessCorrect access; never put the key in the browser
429Rate limit versus exhausted quota in the errorBack off for rate limits; resolve quota before retrying
Waiting for a functionCurrent required_actions, tool name, turn_id and call_idValidate and return the matching tool result
Waiting for computeenvironment_connection action and executor healthConnect the owning environment; recheck session state
Idle but no answerRoot turn outcome and saved itemsDo not treat idle as success
No streamed textoutput_text.done and saved message itemsSupport final-only text and paginated history
Duplicate business actionOperation key and prior downstream outcomeReconcile before any repeat execution
Deleted session, compute still billedProvider machine stateStop self-hosted compute separately

Separate webhook and stream names

A webhook uses agent.session.action_required; the live stream uses agent.session.requires_action. In both cases retrieve current required_actions. Verify webhook signatures against the original body. If your database or queue cannot accept the event durably, do not return a successful acknowledgment.

Recover output without claiming event replay

Reconnect and retrieve saved items and turns; use pagination. Merge by item identity and use complete output text to replace partial buffers. Saved history does not recreate every missed intermediate event. Only finish the root workflow on its own terminal outcome, and inspect tool results even when the turn completed.

Know when to stop retrying

Stop automatic retries when credentials are invalid, arguments require correction, a side effect has an unknown outcome, or the task budget is exhausted. Preserve the session ID and show an actionable failure state. A lost connection can leave work running; a browser retry button should not silently create a second job.

Read the official reference

Check the source for current API fields, account requirements, and service limits.

OpenAI: events Sandbox recovery and cleanup API error codes

38 matching topics

What is the OpenAI Agents API?FoundationsAgents API vs Agents SDK vs Responses APIComparisonsAgents API quickstartGetting startedSessions, turns & durable stateCore conceptsHosted vs self-hosted sandboxesInfrastructureConnect MCP servers to Agents APITools & integrationsFunction calling & application toolsTools & integrationsMulti-agent orchestrationCore conceptsStreaming, webhooks & event handlingIntegration guidesFiles, outputs & published artifactsCore conceptsVaults & MCP authenticationTools & integrationsAgent security & credential boundariesProductionTracing, usage & debuggingProductionAgents API pricing & cost planningProductionOpenAI Agents API with PythonGetting startedAgents API with TypeScript & Next.jsIntegration guidesWhat is the OpenAI Agents SDK?FoundationsResponses API in the agent stackFoundationsAgent Skills & SKILL.mdTools & integrationsProgrammatic Tool CallingTools & integrationsRAG, file search & vector storesTools & integrationsWeb search & source citationsTools & integrationsChatKit & Agent BuilderIntegration guidesAgent configuration & reusable definitionsCore conceptsPlugins: connect skills and MCP toolsTools & integrationsSandbox lifecycle & executor connectionsInfrastructureWebhook verification, queues & deduplicationIntegration guidesAgent retries, timeouts & failure recoveryProductionAgent evaluations & regression testingProductionWhich parts of the agent stack do you need?FoundationsAgents API contract quick referenceIntegration guidesOrder agent reference: approval, recovery & evaluationIntegration guidesBuild a Next.js order agent: server, tools & streamingIntegration guidesPython Agents API example with a real tool loopGetting startedHuman approval & prompt injection defensesProductionAgents API troubleshooting: symptoms, checks & recoveryProductionAgent tool support & runtime ownership matrixComparisonsAgent resources, relationships & task stateCore concepts
K to open Esc to close