pub fn resolve_session_id(explicit_session: Option<&str>) -> Result<String>Expand description
Resolve the session ID for any CLI command.
This is the single source of truth for session resolution.
Every session-scoped command must use this instead of the old
current_project_path() + list_sessions("active", 1) pattern.
Priority:
- Explicit
--sessionflag (from CLI or MCP bridge) SC_SESSIONenvironment variable- TTY-keyed status cache (written by CLI/MCP on session start/resume)
- Error — no fallback, no guessing