[idea] Support agent status detection when inside a PID-namespace sandbox (bubblewrap/fence) #679
Replies: 8 comments 7 replies
|
@ogulcancelik I'm keen to work on this if you agree with the approach 🙂 |
|
Aha! 😃 |
|
I have the macOS compliment to the above if you want it @ogulcancelik. Perhaps it's obvious, but my exact use case is to execute this on macOS with proper agent status detection: This comment is for following the new contributor process. However, I'm not offended at all if you just implement yourself. Given the speed of development for this project I wouldn't be surprised if you did 😂 |
|
What is required to make it work ? |
|
Branch is here: https://github.com/jpeeler/herdr/commits/feat/agent-env-hint-macos/. |
|
this should be covered now via and if it is, please close the discussion, or let me know! |
|
Glad to find this discussion thread active! New to herdr but also very used to running claude inside nono on macOS. Just tried a bunch of nono and fence invocations while checking the output of Observations:
|
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.All reactions