On macOS, mux-activity cannot tell which session a background Claude agent belongs to from its environment.
Each backend looks for a marker the agent inherited from the pane that started it: REX_SESSION for Rex, and the matching variables for Herdr and Luvus. It reads them with tc::procfs::read_environ, which opens /proc/<pid>/environ. That file does not exist on macOS, so the read always fails.
What happens today on a Mac: the marker step is skipped. The job is then filed by directory, or shown under BACKGROUND AGENTS. It is never filed in the wrong session; it just loses the exact match.
This predates stealth-factory/opscope#643**.** On main, core's claude_root_of and claude_fallback_root_of already depend on the same Linux-only reader. Codex raised it on PR stealth-factory/opscope#647, and we chose to track it here instead of widening that PR.
What done looks like
- Core has a macOS way to read another process's environment, put behind
mod hostwith the parsing in an always-compiledparse_*function, as the repo's three-tiercfgrule requires. - Rex, Herdr and Luvus find their session marker on macOS as they do on Linux.
- Core's
claude_root_ofandclaude_fallback_root_ofwork on macOS too. - Built and tested on a Mac, or on CI's hosted Mac when no Mac is available.
Agent notes
- The likely route is
sysctlwithKERN_PROCARGS2, which returns argv followed by the environment for a process the caller owns. Check how it behaves for processes owned by another user, and under hardened runtime. - Callers:
rex_markerinwidgets/src/widgets/mux-activity/rex.rs, the Herdr and Luvus marker functions, andclaude_root_of/claude_fallback_root_ofincore/src/agent_work.rs. - Codex's comment is on PR stealth-factory/opscope#647,
rex.rs, comment 4582730549.
OPS-294