fix(agents): completed 를 확인한 쪽이 세션 ID 를 등록하고, agy 는 다른 작업 공간의 대화를 받지 않는다 (Issue #40) #67

Merged
Godopu merged 3 commits from fix/issue-40-auto-pin into main 2026-10-20 17:12:55 +00:00
Owner

Refs #40

변경

  • 세션 ID 가 생성 뒤에 생기는 에이전트(agy·opencode·codex·hermes)의 ID 를, 잡의 completed 를 확인한 쪽이 등록한다.
    • 진입점: 위임 래퍼, create --onboard, 루프 wait_for_job(복구 경로).
    • 데몬이 없어도(MAM_NO_SUBSCRIBER_DAEMON=1) 등록된다.
    • 잡·토큰·시도 하나는 한 번만 처리한다.
    • 후보가 모호하거나 확인할 수 없으면 등록하지 않고 이유를 행에 남긴다.
  • 어댑터 규격: id_lifecycle, capture_active_session_id. reconcile drift C 도 같은 capture 를 쓴다.
  • agy:
    • 다른 작업 공간에 매핑된 ID 는 거절한다.
    • 대화 폴더 전체 glob 은 없앴다.
    • 캐시가 가리키는 대화도 pane 프로세스가 열고 있음을 lsof·ps 로 확인해야 등록한다.
  • 스킬 블록 목록(tests/data/skill_code_blocks.json)의 줄 번호를 갱신했다.
  • v4.9.9 릴리스 커밋(리뷰 리포트 보관, 버전 락스텝).

검증

  • 리뷰: --plan --all-reviewer 1회차 4/4 PASS(@feccfd5).
  • 회귀: tests/test_issue40_auto_pin.py 27개(base 에서 실패).
  • 전체 스위트(macOS, Python 3.9):
    • @feccfd5: 2068 passed, 56 skipped, 3 failed. 실패는 모두 스킬 블록 목록의 줄 번호였다.
    • 목록 갱신 뒤 해당 파일 37 passed, 1 skipped. 버전 일관성 테스트도 통과.
  • 실제 홈·herdr 서버·opencode 서비스에 남긴 것 없음.

비차단 / 남은 것

  • lsof 가 없는 환경에서는 agy 가 자동 등록되지 않는다(오등록보다 미등록을 택함). Linux 확인이 필요하다.
  • reconcile 은 ambiguous 외의 capture 실패 이유를 남기지 않는다.
  • id 가 빈 claude 행의 pre-assigned 보호 테스트는 없다.
  • stop 의 캡처 경로 정리는 범위 밖이다.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff

Refs #40 ## 변경 - 세션 ID 가 생성 뒤에 생기는 에이전트(agy·opencode·codex·hermes)의 ID 를, 잡의 completed 를 확인한 쪽이 등록한다. - 진입점: 위임 래퍼, `create --onboard`, 루프 `wait_for_job`(복구 경로). - 데몬이 없어도(`MAM_NO_SUBSCRIBER_DAEMON=1`) 등록된다. - 잡·토큰·시도 하나는 한 번만 처리한다. - 후보가 모호하거나 확인할 수 없으면 등록하지 않고 이유를 행에 남긴다. - 어댑터 규격: `id_lifecycle`, `capture_active_session_id`. reconcile drift C 도 같은 capture 를 쓴다. - agy: - 다른 작업 공간에 매핑된 ID 는 거절한다. - 대화 폴더 전체 glob 은 없앴다. - 캐시가 가리키는 대화도 pane 프로세스가 열고 있음을 `lsof`·`ps` 로 확인해야 등록한다. - 스킬 블록 목록(`tests/data/skill_code_blocks.json`)의 줄 번호를 갱신했다. - v4.9.9 릴리스 커밋(리뷰 리포트 보관, 버전 락스텝). ## 검증 - 리뷰: `--plan --all-reviewer` 1회차 4/4 PASS(@feccfd5). - 회귀: `tests/test_issue40_auto_pin.py` 27개(base 에서 실패). - 전체 스위트(macOS, Python 3.9): - @feccfd5: 2068 passed, 56 skipped, 3 failed. 실패는 모두 스킬 블록 목록의 줄 번호였다. - 목록 갱신 뒤 해당 파일 37 passed, 1 skipped. 버전 일관성 테스트도 통과. - 실제 홈·herdr 서버·opencode 서비스에 남긴 것 없음. ## 비차단 / 남은 것 - `lsof` 가 없는 환경에서는 agy 가 자동 등록되지 않는다(오등록보다 미등록을 택함). Linux 확인이 필요하다. - reconcile 은 `ambiguous` 외의 capture 실패 이유를 남기지 않는다. - id 가 빈 claude 행의 `pre-assigned` 보호 테스트는 없다. - stop 의 캡처 경로 정리는 범위 밖이다. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
Godopu added 3 commits 2026-10-20 17:12:52 +00:00
- BaseAgentAdapter: id_lifecycle (pre_assigned: claude, grok / post_discovered)
  and capture_active_session_id - exactly one verified candidate newer than the
  session that no other row records, else a reason (no-candidate, ambiguous, ...).
- agy: verify_artifact (discover) rejects an id last_conversations.json maps to
  another workspace and always excludes ids other rows record (a cache hit no
  longer bypasses it). capture uses the cache only as a proposal: the
  conversation's presence lock or DB must be held by the row's pane process or
  a descendant (lsof/ps); anything unprovable is not pinned.
- lib_py/agents/autopin.py: handle_completed, run by the side that verified the
  job's completed - the delegate-job wrapper (direct), create --onboard and the
  loop's wait_for_job (recovery, as a subprocess: G9). Local herdr jobs only;
  one (job, dispatch token, attempt) is handled once (job-scoped flock + marker
  in the job dir); writes go through atomic_dump_yaml; a pin records
  session_id_source=discovered / session_id_verified=true; a failure leaves the
  reason on the row and never changes the job's result.
- reconcile.sh drift C for agy, hermes, opencode and codex calls the same
  capture (the agy *.db glob is gone); _pin_and_verify_resume uses pin_row.
- Tests: tests/test_issue40_auto_pin.py; issue64 :407 now expects False; the
  static reconcile-source checks follow the move to the adapters; the two tier2
  drift-C component tests create with --no-onboard (onboarding now pins).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The skill-block inventory recorded line numbers that the auto-pin change moved:
one create block, two monitor blocks, and the reconcile.sh evidence for the
drift A example (601 -> 593) and the status --json example (1084, past the new
end of the file -> 816).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01VCgu9Fa9iT7TbJUSzdq4Ff
Godopu merged commit dc886ecd6b into main 2026-10-20 17:12:55 +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#67