From f8bdf302fd71ba73ae1424d86275e1e223f09cf3 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Mon, 15 Jun 2026 01:14:46 -0500 Subject: feat(ai): add agent-roster detection script with tests agent-roster is the single detection primitive for concurrent same-project Claude sessions: pgrep -x claude, resolve each pid's cwd from /proc, keep those at or inside the project root, and drop the scanner's own ancestry. It exits 0 when alone, 1 when other agents are present (printed pid + cwd), and 2 when the roster can't run. Both the helper launcher and the in-session startup check will call this rather than re-scanning. pgrep and /proc are the system boundary, so I made them injectable (ROSTER_PGREP, ROSTER_PROC, ROSTER_SELF_PID) and the bats exercise the real include/exclude logic against fixtures, no agents spawned. The unavailable paths (no /proc, or pgrep absent) report on stderr and exit 2 rather than a false "alone". This is the first slice of the helper-instance task. Startup and ai --helper wiring follow. --- todo.org | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'todo.org') diff --git a/todo.org b/todo.org index 8eb0b02..43f6d2a 100644 --- a/todo.org +++ b/todo.org @@ -43,7 +43,7 @@ Optional wrap-up step that surfaces filed keepers belonging to another project, Spec: [[file:docs/design/wrapup-routing-spec.org]]. Source proposal: [[file:docs/design/2026-06-13-wrapup-inbox-transcript-routing-proposal.org]] (archsetup handoff 2026-06-13). Next: =spec-review=. -** TODO [#B] Helper-instance support — concurrent same-project Claude :feature:spec: +** DOING [#B] Helper-instance support — concurrent same-project Claude :feature:spec: :PROPERTIES: :CREATED: [2026-06-11 Thu] :LAST_REVIEWED: 2026-06-12 -- cgit v1.2.3