Python SDK 0.13.0 includes the durable initial-history replay fix (AGNT5-1108), the merged response-wait behavior, and published SDK core 0.3.1 for graceful draining of accepted pull work during intentional shutdown, including Unix SIGTERM (AGNT5-1129).
Upgrade prerequisite
Deploy the AGNT5-1108 runtime compatibility fix before upgrading deployed Python workers. It accepts the session creation event emitted with durable completion. Publishing or installing this package does not deploy that runtime prerequisite.
Breaking changes and migration
Client.run()andAsyncClient.run()now return accepted202pending receipts directly instead of polling detached runs to completion. Checkresponse.is_pendingbefore consumingresponse.output. Synchronous callers can continue waiting withclient.wait_for_result(response.run_id, timeout=...); async callers can useget_status()andget_result()under their own bounded polling policy.- Gateway response waiting defaults to 300 seconds. Set
wait_timeoutfrom zero to 86400 seconds; zero returns after acceptance. Accepted execution continues after waiting ends or the client disconnects. - Default HTTP operation timeouts allow at least
wait_timeout + 10seconds (310 seconds by default), or the client timeout if longer. Set per-calltimeoutexplicitly when needed. - Event streams expose
stream.wait_expiredorstream.detached; chunk-onlystream()raisesRunErrorcarrying the run ID when response waiting ends. Retain that run ID to retrieve status/results. WorkflowProxy.run()reservestimeoutandwait_timeout;WorkflowProxy.stream_events()additionally reserveswait_timeout. Pass payload fields with those names through the explicit input dictionary ofclient.run(..., component_type="workflow")orclient.stream_events(...).
The history fix preserves the initial snapshot across replay for runs that record it after upgrade. It cannot reconstruct a missing snapshot for a run already in flight on an older SDK. Fresh runs continue to load the session's latest history.
Dependency and validation
The native extension builds against crates.io agnt5-sdk-core 0.3.1 using its published checksum. Local validation passed a fresh native build, 67 focused tests, and 891 unit tests (13 skipped), plus Ruff, Rust formatting, locked dependency resolution, and source-package inspection. The release workflow builds Linux x86_64 and ARM64 wheels, a macOS ARM64 wheel, and a source distribution.