fix(stall_watch): herdr 를 변환된 에이전트 이름으로 부른다 (Issue #66) #70

Merged
Godopu merged 2 commits from fix/issue-66 into main 2026-10-25 05:07:20 +00:00
Owner

Refs #66

변경

범위는 #66 의 작업 범위 댓글 그대로다.

  • lib_py/stall_watch.py: herdr 를 부를 때만 세션 이름을 sanitize_herdr_agent_name() 으로 바꾼다.
    • HerdrSource 의 agent get·agent read·agent prompt, watcher.wait_once 가 변환된 이름을 쓴다.
    • 로그와 알림에는 원래 세션 이름이 그대로 나온다.
    • 에이전트 종류 판정(resolve_agent)은 원래 이름으로 한다. 32자를 넘는 이름은 변환하면 끝이 해시라서 종류를 읽을 수 없기 때문이다.
  • mock herdr (tests/conftest.py): strict_agent_names 옵션을 더했다. 켜면 실제 herdr 처럼 등록된(변환된) 이름에만 답하고, 원래 이름에는 agent_not_found 를 낸다. 기본은 꺼져 있어 기존 테스트가 보는 동작은 그대로다.
  • --name 길이 제한과 create 경고는 범위 댓글대로 하지 않았다.
  • 버전 번호와 VERSIONS.md 는 바꾸지 않았다.

검증

  • 리뷰: --plan-file --all-reviewer 루프 1회차에서 리뷰어 4명이 모두 PASS 를 냈다(bb496fd).
  • 회귀: tests/test_issue66_stall_watch_sanitized_name.py 7개.
    • 32자를 넘는 이름과 대문자 이름으로 stalled:idle·stalled:blocked 가 나고, herdr 의 agent get/read/prompt/wait 호출이 모두 변환된 이름이다(mock 호출 기록으로 확인).
    • 로그에 원래 이름이 나온다.
    • --agent 없이 긴 codex 이름의 종류가 원래 접미사로 정해진다.
    • base(0461a63) 에서는 5개가 실패한다. 통과하는 2개는 mock 자체를 확인하는 테스트와 변환이 필요 없는 이름이다.
  • tests/test_issue30_stall_watch.py·tests/test_issue30_stall_watch_stop.py 는 바꾸지 않았고 그대로 통과한다.
  • 전체 스위트(Linux, Python 3.14): bb496fd 에서 2140 passed, 20 skipped, 1 failed.
    • 실패는 test_issue17_item4_decisions.py::test_c_finalize_ends_with_an_unreaped_wrapper[broker_unavailable-3-0] 하나다. 테스트의 finally 에서 프로세스 그룹이 살아 있다고 확인한 직후 사라져 os.killpg 가 ProcessLookupError 를 냈다(정리 단계의 경합).
    • 따로 5번 돌리면 매번 통과했다(10/10). 이 브랜치는 위임 래퍼와 그 테스트를 건드리지 않는다.

비차단 / 남은 것

  • 변환은 main 한 곳이 아니라 HerdrSource 와 StallWatch 의 생성자 두 곳에서 한다. 둘 다 같은 --target 에 같은 함수를 적용하므로 결과는 같다.
  • 위임 래퍼(start_stall_watch)부터 이어지는 끝-끝 테스트는 없다. 래퍼는 바꾸지 않았다.
  • macOS(bash 3.2, Python 3.9)에서는 아직 돌리지 않았다. 한 리뷰어가 Python 3.9 문법 검사만 했다.

🤖 Generated with Claude Code

Refs #66 ## 변경 범위는 #66 의 작업 범위 댓글 그대로다. - **`lib_py/stall_watch.py`**: herdr 를 부를 때만 세션 이름을 `sanitize_herdr_agent_name()` 으로 바꾼다. - `HerdrSource` 의 `agent get`·`agent read`·`agent prompt`, `watcher.wait_once` 가 변환된 이름을 쓴다. - 로그와 알림에는 원래 세션 이름이 그대로 나온다. - 에이전트 종류 판정(`resolve_agent`)은 원래 이름으로 한다. 32자를 넘는 이름은 변환하면 끝이 해시라서 종류를 읽을 수 없기 때문이다. - **mock herdr (`tests/conftest.py`)**: `strict_agent_names` 옵션을 더했다. 켜면 실제 herdr 처럼 등록된(변환된) 이름에만 답하고, 원래 이름에는 `agent_not_found` 를 낸다. 기본은 꺼져 있어 기존 테스트가 보는 동작은 그대로다. - `--name` 길이 제한과 create 경고는 범위 댓글대로 하지 않았다. - 버전 번호와 VERSIONS.md 는 바꾸지 않았다. ## 검증 - 리뷰: `--plan-file --all-reviewer` 루프 1회차에서 리뷰어 4명이 모두 PASS 를 냈다(bb496fd). - 회귀: `tests/test_issue66_stall_watch_sanitized_name.py` 7개. - 32자를 넘는 이름과 대문자 이름으로 `stalled:idle`·`stalled:blocked` 가 나고, herdr 의 `agent get/read/prompt/wait` 호출이 모두 변환된 이름이다(mock 호출 기록으로 확인). - 로그에 원래 이름이 나온다. - `--agent` 없이 긴 codex 이름의 종류가 원래 접미사로 정해진다. - base(0461a63) 에서는 5개가 실패한다. 통과하는 2개는 mock 자체를 확인하는 테스트와 변환이 필요 없는 이름이다. - `tests/test_issue30_stall_watch.py`·`tests/test_issue30_stall_watch_stop.py` 는 바꾸지 않았고 그대로 통과한다. - 전체 스위트(Linux, Python 3.14): bb496fd 에서 2140 passed, 20 skipped, 1 failed. - 실패는 `test_issue17_item4_decisions.py::test_c_finalize_ends_with_an_unreaped_wrapper[broker_unavailable-3-0]` 하나다. 테스트의 `finally` 에서 프로세스 그룹이 살아 있다고 확인한 직후 사라져 `os.killpg` 가 `ProcessLookupError` 를 냈다(정리 단계의 경합). - 따로 5번 돌리면 매번 통과했다(10/10). 이 브랜치는 위임 래퍼와 그 테스트를 건드리지 않는다. ## 비차단 / 남은 것 - 변환은 `main` 한 곳이 아니라 `HerdrSource` 와 `StallWatch` 의 생성자 두 곳에서 한다. 둘 다 같은 `--target` 에 같은 함수를 적용하므로 결과는 같다. - 위임 래퍼(`start_stall_watch`)부터 이어지는 끝-끝 테스트는 없다. 래퍼는 바꾸지 않았다. - macOS(bash 3.2, Python 3.9)에서는 아직 돌리지 않았다. 한 리뷰어가 Python 3.9 문법 검사만 했다. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Godopu added 1 commit 2026-10-24 16:02:59 +00:00
herdr registers an agent under sanitize_herdr_agent_name(session), so a
session name over 32 characters or with upper-case letters got
agent_not_found and stall detection went off. stall_watch now converts the
name for every herdr call (agent get/read/prompt, watcher.wait_once); logs
and notices keep the original name, and the agent kind is still read off
the original suffix (a long name's sanitized form ends in a hash).

The conftest mock herdr gets an opt-in strict_agent_names mode that, like
the real herdr, answers an agent only under its registered name and fails
get/read with agent_not_found JSON; existing tests see no change.

Refs #66

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Godopu added 1 commit 2026-10-25 05:07:16 +00:00
Godopu merged commit 29cc4fd904 into main 2026-10-25 05:07:20 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: tmpl/multi-agent-mux#70