pub fn session_of_process(pid: u32) -> Option<(String, PathBuf)>Expand description
The Codex session a process runs: the root rollout (one with no parent
thread) among the files pid holds open, as (session id, rollout path).
None when pid holds no Codex rollout.
This is how a command run from a Codex shell learns which session ran it:
its ancestry reaches the codex process, and that process owns exactly
the rollout of its conversation (subagent rollouts name their parent).
Codex’s shared app-server daemon holds the rollouts of every thread it has loaded; a process holding more than one conversation names none of them.