Applied AI
An approved agent can resume with a different context
Test Pydantic context round trips in an agent approval workflow so resumed actions retain stable keys and changed fields.
October 28, 2026
An agent pauses for human approval, saves state, and later resumes a consequential tool call. A recent OpenAI Agents SDK issue reports that Pydantic fields changed in place can disappear from the serialized context, and UUID or datetime values can make string serialization fail. The issue was closed by the time of this research; that status does not establish which installed versions contain a fix.
Test the full approval round trip
Build a fixture with a default list changed in place, a nested model changed in place, a generated idempotency key, and typed UUID and datetime fields. Pause before an approval-required tool, serialize with the same method production uses, restore with the configured deserializer, and compare the values the tool actually receives. Test untouched defaults as well as explicit assignments. A JSON dump that looks plausible is not enough if the restored context changes the action.
Preserve action identity across retries
The SDK's human-in-the-loop guidance says approval does not guarantee exactly-once external execution and recommends stable idempotency keys for consequential actions. If a restored default factory generates a new key, a retry can lose that protection. Store the action parameters and key at a durable boundary you control, and reconcile with the destination before retrying an uncertain operation.
Pin, test, then upgrade
Capture the Agents SDK version and the exact serialization path. Add a regression test around the pause, save, restore, approval, and tool invocation sequence. Before upgrading, check the issue's resolution and run that test against the candidate release. The RunState reference treats serialized state as a durable resume boundary; the application still owns the correctness of its context and external side effects.
Adovo’s view
Approval is permission for a particular action, not permission for whatever a restored object becomes. Bind the decision to stable parameters and prove the state survives a round trip. The failure mode hides between the review screen and the tool call.
