feat(issue-30): a stall watcher that only notifies

lib_py/stall_watch.py runs beside the wrapper's subscriber for a local herdr
job (started after delivery, stopped when the subscriber ends; MAM_STALL_WATCH=0
turns it off). It follows `herdr agent wait` transitions and publishes only
`progress` events through one publisher; it has no path that closes a job.

- blocked: `stalled:blocked <detection line>` once per episode, never answered.
- idle for MAM_STALL_IDLE_S (600) with no background descendants of the agent
  pid (pane process-info + /proc; adapter resident_children and the heartbeat
  timer excluded) and an empty input box: `stalled:idle` and one nudge.
- input box judged from adapter facts measured on herdr 0.9.1 (codex '›',
  grok frame '│', opencode '┃' block + stop pattern); the whole-pane fallback
  is gone. No facts: withheld + `stall_watch:input_check_unavailable` once;
  never empty for 3 x S: `stall_watch:input_never_empty` once.
- herdr failures are not "no event": warning + `stall_watch:herdr_unavailable:
  <code>` (or agent_not_found), backoff, rc 2 after MAM_STALL_HERDR_FAIL_S
  (120); the wrapper prints the watcher's last lines.
- remote and human jobs are skipped with one log line.
- agent_status_reliable is an adapter field; false turns idle judgement off.
- the loop runner relays stalled:/stall_watch: notices once each.
- scoped_env drops a pane-inherited workspace scope for name lookups (#34 rule).

The module sits at the top of lib_py: delegation and loop may not import the
agent adapters (their sibling-import rules). Idle pane captures of the five
CLIs are fixtures; the mock herdr answers process-info in the real shape.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
GodopuandClaude Opus 5.5 committed 2026-09-25 11:43:21 +00:00
1 parent ec9586bb9b
commit 622c1f8a9d
18 files changed
+1245 -30

No files matched your search

+16
View File
@@ -0,0 +1,16 @@
# captured 2026-09-25 from an idle agent, input box empty: herdr 0.9.1 `herdr agent read reviewer-agy-01` (last 15 lines)
• All 70 tests passed in 161.02s.
• Combined Test Total: 87 passed, 0 failed.
• Cleanup: Temporary scratch files in /tmp have been purged.
──────
### 4. Deliverables
• Review Report: Saved to report-final.md ending with standalone line
[VERDICT: PASS].
• Delegation Event: Published completed event with dispatch token
4988b0584e6b4da4af4be4d94f5f1328. Job transitioned to completed.
───────────────────────────────────────────────────────────────────────────
>
───────────────────────────────────────────────────────────────────────────
? for shortcuts Gemini 3.8 Flash · high
+16
View File
@@ -0,0 +1,16 @@
# captured 2026-09-25 from an idle agent, input box empty: herdr 0.9.1 `herdr agent read planner-reviewer-claude-01` (last 15 lines)
Remote and human jobs are skipped with one log line. Status reliability
lives in an adapter field that gates the idle judgement.
A new section maps each rule to the code that enforces it and the test
that pins it, and lists the four rules that cannot be enforced in code.
Documentation shrinks to usage lines and table rows. The tests use the
real wrapper, subscriber, registry, publish script and watcher with real
process trees, and the 14-minute end-to-end scenario runs once.
✻ Cogitated for 12m 56s · done 11:04 AM
✔ Update installed · Restart to update
────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────
⏵⏵ bypass permissions on (shift+tab to cycle) · ← for agents
+16
View File
@@ -0,0 +1,16 @@
# captured 2026-09-25 from an idle agent, input box empty: herdr 0.9.1 `herdr agent read planner-reviewer-codex-01` (last 15 lines)
• Explored
└ Search "status"|"detail"|"completed" in b8682c96.json
• 리뷰를 PASS로 완료했습니다. 추가 검증 3개와 정적 검사를 통과했으며,
completed 발행과 상태 반영을 확인했습니다.
최종 리포트 (.mam/jobs/b8682c96/codex-reports/report-final.md)
Worked for 5m 5s · done 2:00 AM
› Ask Codex to do anything
gpt-6-astra high · ~/PuKi/laa/canary_projects/multi-agent-mux · Complete…
+16
View File
@@ -0,0 +1,16 @@
# captured 2026-09-25 from an idle agent, input box empty: herdr 0.9.1 `herdr agent read reviewer-grok-01` (last 15 lines)
Worked for 2m54s
█
Help improve Grok [Opt out] [Opt in]
Off by default. Opt-in to allow SpaceXAI to retain coding data, e.g.,
prompts, traces, & metrics, for training and debugging purposes. Change
anytime via settings.
Read Terms and Privacy Policy.
╭──────────────────────────────────────────────────────────────────────╮
│ ❯ │
╰─────────────────────────────────── Grok 4.7 (high) · always-approve ─╯
Shift+Tab:mode │ Ctrl+.:shortcuts
+16
View File
@@ -0,0 +1,16 @@
# captured 2026-09-25 from an idle agent, input box empty: herdr 0.9.1 `herdr agent read reviewer-opencode-01` (last 15 lines)
유출시키고 있습니다. 하위 워크스페이스 접두사가 테스트 export와 일치하는 pane에서 실행될 때 H-21이 잘못
실패합니다. 이는 제 자신의 w2 pane에서 재현되었으며, 환경을 제거한 상태로 재실행하면 통과됩니다. 한 줄의
unset 수정으로 해결됩니다. MAM 자체 사용 모델(pane에서 에이전트 실행 테스트)에서는 이 문제가 재발
가능합니다.
보고서: .mam/jobs/2986037e/opencode-reports/report-final.md — VERDICT: PASS
▣ Build · GLM 5.3 Cloud · 26m 12s
┃
┃
┃ ~/PuKi/laa/canary_projects/multi-
┃ Build auto · GLM 5.3 Cloud Ollama agent-mux:main
╹▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
/home/godopu16/PuKi/laa/canary_projects/multi-agent-mux 629.5K ctrl+p commands • OpenCode 1.18.32