Full-lifecycle session context manager (init → bind → end on exit)
session
context manager creates a new session, binds it to the current async/thread context, and automatically ends it when the context exits. This is the recommended pattern for self-contained workflows.
session_name
(string, optional): Display name for the session.session_id
(string, optional): Provide to resume under this ID; otherwise a new one is created.api_key
, agent_id
(string, optional): Credentials; fall back to LUCIDIC_API_KEY
and LUCIDIC_AGENT_ID
.task
, rubrics
, tags
(optional): Session metadata.providers
(list, optional): Instrumentation targets like "openai"
, "anthropic"
, etc.masking_function
(callable, optional): Mask sensitive data before sending.auto_end
(bool, optional): Ignored inside this context; session always ends on exit.with
block.
lucidic.session_id
at start for correct attribution.