pub fn session_root(
env_root: Option<String>,
cwd_root: Option<String>,
) -> Option<String>Expand description
The session’s project root from the host env and the server’s working dir.
LEAN_CTX_PROJECT_ROOT is a pin. Placed in a user-global agent config (as
builds before the pin heal did) it names one project for every session,
so a Codex session started in repo B silently ran against repo A. When the
server was started inside a different real project, that working directory
is this session’s project and outranks the pin. Host-specific signals
(CLAUDE_PROJECT_DIR, workspace folders, …) are session-scoped already and
keep precedence; a cwd inside the pinned tree keeps the pin.