[idea] Support agent status detection when inside a PID-namespace sandbox (bubblewrap/fence) #679
flexiondotorg
started this conversation in
Ideas
Replies: 2 comments
-
|
@ogulcancelik I'm keen to work on this if you agree with the approach 🙂 |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Aha! 😃 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
idea / problem
herdr does not detect a coding agent inside a PID-namespace sandbox (bubblewrap, or
fence= bubblewrap + Landlock). The pane shows no agent and no status. Claude Code and Codex fail; Pi and OpenCode work via their socket hooks.Reproduce
Run
fence -- claude(orcodex) in aherdrpane.Expected vs actual
Root cause
herdridentifies the agent by matching the pane's foreground process name from host/proc(src/platform/linux.rs,src/detect/mod.rs). The sandbox runs the agent in its own PID namespace behind a wrapper chain, so the foreground process isbwrap, not the agent. The match returnsNone, sodetected_agentis unset and state scraping never runs. The agent's OSC and screen signals still reach the pane; only identification breaks.requested change
Read an env hint, e.g.
HERDR_AGENT=claude, from the foreground leader's/proc/<pid>/environinprobe_foreground_process(src/pane.rs) and use it as the agent, skipping the name match. An absent or unknown value falls through. This reuses the existing/procaccess and needs no new IPC; env passes through the sandbox unchanged.I have a branch with the proposed fix here:
why you want this
I want to use
herdr, its ace! But, I run all my coding agents insidefence, and that breaks the status updates.Beta Was this translation helpful? Give feedback.
All reactions