Turn Lease Token • AI Agent SDK

TurnLeaseToken: An opaque handle to a held turn lease (Issue #3643).

TurnLeaseToken

Defined in the protocols module.

AI Agent

An opaque handle to a held turn lease (Issue #3643).

Returned by :meth:TurnLockProtocol.acquire and passed back to :meth:TurnLockProtocol.release. The `owner token identifies the replica/process that holds the lease so a distributed backend can make release` identity-checked and idempotent — a replica can only release the lease it actually owns, and a stale/expired lease that has since been reclaimed by another owner is never clobbered.

Attributes: key: The resolved session id the lease serialises on. owner: The holder’s opaque owner token (e.g. a per-replica id). expires_at: Absolute wall-clock expiry (same clock the backend uses). A dead holder’s lease is reclaimable once `now` passes this, so a crashed replica cannot wedge a healthy session forever.

Properties

ResponseField str

No description available.

ResponseField str

No description available.

ResponseField float

No description available.

Source

View on GitHub

praisonaiagents/gateway/protocols.py at line 7343