Expand description
Conversation sessions.
Rust equivalent of upstream’s _sessions.py. Upstream deleted
_threads.py and _memory.py, consolidating a lightweight AgentSession
({session_id, service_session_id, state}) with memory/context providers.
Conversation history left the session entirely: it is now injected by a
HistoryProvider — just another
ContextProvider — via before_run/after_run, instead of being owned
by a message store on the thread/session itself.
A session is no longer “service-managed XOR locally-stored”: it always
carries a session_id, optionally a service_session_id (when the
underlying service manages the conversation server-side), a bag of
free-form state, and the context_providers that run on every use.
Structs§
- Agent
Session - A conversation session: a lightweight identity + state container.
- Session
State - The free-form state bag of an
AgentSession, shared by reference across clones.
Constants§
- MESSAGE_
INJECTION_ PENDING_ MESSAGES_ STATE_ KEY - The session-state key holding messages queued for injection; see
enqueue_messages. Upstream’sMESSAGE_INJECTION_PENDING_MESSAGES_STATE_KEY.
Functions§
- enqueue_
messages - Queue
messagesfor the next model call of a run onsession. - pending_
messages - A snapshot of the messages queued on
session.