fix(lib): handle agent_not_ready startup state and reject claude fullscreen upsell modal

- Accept agent_not_ready from herdr agent start to allow startup dialog handling without premature rollback, while preserving fail-closed behavior on dead process timeouts.
- Match Claude fullscreen renderer upsell modal via 'Yes, try it' and dismiss with Escape to avoid dropping permission flags or deadlocking on idle /tui tips.
- Add behavioral test suite in test_b19_headless_reconcile_fixes.py and cross-agent review reports.
This commit is contained in:
2026-08-27 10:17:53 +09:00
parent d875584ef4
commit 4bbd03bf2d
5 changed files with 402 additions and 4 deletions
+22
View File
@@ -0,0 +1,22 @@
### 수정 내역 (lib.sh)
1. 에이전트 시작 판별 조건 완화 (new-session / `agent start`)
- 치명적 CLI 오류(`^usage:` / `^error:` 등)를 **성공 분류보다 먼저** 판별한다.
- `agent_started`뿐 아니라 herdr 문서의 `agent_not_ready`(프로세스는 살아 있고 다이얼로그에 막힘)도
롤백하지 않고 `wait_for_tui_ready`로 넘긴다.
- `timed out waiting for agent startup`**성공으로 승격하지 않는다.** herdr는 `/bin/false`처럼
이미 죽은 프로세스에도 같은 메시지를 반환하므로, 이 토큰은 실패와 지연을 구분하지 못한다.
2. Claude 풀스크린 렌더러 업셀 모달
- 차단형 모달 고유 시그니처는 `Yes, try it`이다. `_MAM_DIALOG_TOKENS`
`handle_startup_dialogs`는 이 문자열만 쓴다.
- 거절은 **Escape**다. Enter는 기본 선택지 `Yes, try it`을 수락하고 세션을 permission flag 없이
재시작한다.
- idle 팁 `Try the new fullscreen renderer — … · /tui fullscreen`은 입력을 막지 않으므로
다이얼로그로 취급하지 않는다. 광의 토큰 `fullscreen renderer|Try the new fullscreen`
팁과 모달을 동시에 매칭해 `wait_for_tui_ready`를 데드락 시킨다.
3. 검증: `tests/test_b19_headless_reconcile_fixes.py`에서 `_pane_capture`를 stub 한 행위 테스트
(모달 vs 팁).