Overview
Sessions work as both sync and async context managers. The API is identical — useasync with instead of with.
Usage
Thread safety
Sessions use Python’scontextvars, which are natively async-safe. Each async task sees its own active session — no locking required.
agent-1’s trace never leaks into agent-2.