Skip to main content

session_token

Function session_token 

pub fn session_token(base_url: &str) -> Option<String>
Expand description

Affinity token for the calling conversation, or None when base_url is not an OpenCode target.

ยงCall site placement

This reads a tokio task-local, which does not cross tokio::spawn. The streaming provider paths build their requests inside zeroclaw_spawn::spawn!, whose macro propagates only the tracing span, so calling this from inside a spawned task would silently fall back to the process-stable fallback and lose per-conversation affinity. Resolve the value before the spawn and move it in.