Can Your OpenAI Agents SDK Job Resume Safely?

Keep the OpenAI Agents SDK runner in your application, wire sandbox execution through a documented provider client, and test recovery at the gap between an artifact write and the application’s checkpoint.

Give the application a durable record of each effect

OpenAI places the agent loop and tool routing in the harness. Use that boundary to give each externally visible effect an ID derived from the job and its logical step. For a report export, store the input revision, effect ID, artifact digest, and commit status in application storage. Have the tool return the same receipt if the runner resubmits the same effect ID after losing its response. If a request reuses the ID with changed input, surface a conflict for review. Test this with a synthetic export and stop the test runner immediately after the artifact store acknowledges the write. Start another runner with a clean sandbox. You should observe a single artifact with the expected digest and a receipt the new runner can attach to its checkpoint. Conversation continuity alone cannot establish that an export committed.

Sandbox Agents | OpenAI API

Rehearse stale approvals across both runtime choices

The OpenAI runtime comparison puts deployment, storage, and approvals under application control with the Agents SDK. For an application gate, bind the approval to the proposed effect and its input revision. In a synthetic review job, approve publishing revision A, change the input to revision B, and restart the runner before the export is committed. Require a fresh approval for B and check that the log contains zero external commits during the stale-approval attempt. A second trial should replay the unchanged approved revision and produce exactly one commit. If you compare the SDK with the managed Agents API, keep the same external receipt and approval checks on both paths. Record who restored agent progress, who rebuilt the workspace, and how many seconds elapsed until the verified commit. Those observations show where each architecture carries recovery work.

Agents | OpenAI API

Recover the job in a fresh workspace

The Agents SDK runs inside your application. Give that application a job record containing the input version, last accepted output, and next step. Keep the files required for recovery in storage the application can read independently of the worker. Recreate the workspace from those records and run the next step through the same path a real retry would use.

In an illustrative test, stage a CSV with amounts 14, 6, and 5. Have the first run save a JSON subtotal of 25, validate it, and save it outside the workspace. Start a fresh instance and apply an adjustment of 3 using the saved subtotal. Pass if the final total is 28 and the application accepts the final result once under the same job ID. A second accepted result exposes a retry bug even when the arithmetic is correct.

Agents | OpenAI API

Sources