Function scope_session_key
pub async fn scope_session_key<F>(
session_key: Option<String>,
future: F,
) -> F::Outputwhere
F: Future,Expand description
Run a future with the session key in task-local storage and log attribution. The scope wraps the entire agent turn, so all tools invoked during the turn (including nested calls) see the same session key. SessionsCurrentTool reads this to identify the active session.