Skip to main content

session_of_process

Function session_of_process 

Source
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).