SessionStore
autogen.beta.mcp.sessions.SessionStore #
SessionStore(*, max_sessions=1024, ttl=None, storage=None, clock=monotonic)
Bounded LRU registry mapping an mcp-session-id to a persistent stream.
Each session is bound to a stable :class:~uuid.UUID stream id over a shared :class:Storage; :meth:acquire returns a fresh :class:MemoryStream object on every call (so per-call progress subscribers never accumulate) that reads prior turns back from storage — mirroring the subagents' persistent_stream pattern. Eviction (LRU overflow + idle TTL) drops the evicted session's stored history so memory stays bounded.
Source code in autogen/beta/mcp/sessions.py
session async #
Yield session_id's stream while holding its per-session turn lock.
Holding the lock for the duration of the turn serializes concurrent calls on the same session, so their accumulated history can't interleave.
Source code in autogen/beta/mcp/sessions.py
acquire async #
Return a stream carrying session_id's accumulated history.
Does not hold the turn lock — prefer :meth:session on the serving path.