[HAN-600] Pantheon IncompleteRead 재발 방지 — conversations_history retry 추가
Summary
startup-audit / spec_gate_catchup / fetch_channel_context 의 conversations_history 호출에 IncompleteRead 재시도 로직 추가. PR #274 머지 완료.
Context
Pantheon 채널 누적 메시지 증가로 conversations_history 응답 페이로드가 200KB+ 로 증가.
TCP 전송 중 연결이 끊기면서 http.client.IncompleteRead 발생.
| 날짜 | 경로 | 페이로드 |
|---|---|---|
| 2026-06-08 04:00 | raphael/agent-approvals | ~211KB |
| 2026-06-09 05:26 | jarvis/problem-report | ~95KB |
| 2026-06-09 16:26 | spec-gate-catchup | ~330KB |
| 2026-06-09 16:26 | startup-audit/jarvis DM | ~205KB |
| 2026-06-10 08:37 | jini/northstar | ~134KB |
mention_scan 경로는 HAN-514에서 이미 retry+limit=50 적용됨. 나머지 3개 경로에 패리티 미달이었음.
작업 내용
수정 파일
| 파일 | 위치 | 변경 내용 |
|---|---|---|
audit.py |
_scan_channel |
IncompleteRead retry 1회 추가 |
bridge.py |
fetch_channel_context |
IncompleteRead catch 추가 (기존 SlackApiError only) |
bridge.py |
spec_gate_startup_catchup |
IncompleteRead retry 1회 + from http.client import IncompleteRead import |
패턴 (mention_scan 기존 패턴과 동일)
history = None
for attempt in range(2):
try:
history = client.conversations_history(channel=channel_id, limit=100)
break
except IncompleteRead as e:
if attempt == 0:
log.warning("[audit] IncompleteRead for %s/%s, retrying: %s", ...)
time.sleep(1)
else:
log.warning("[audit] conversations_history skipped for %s/%s (transient): %s", ...)
except Exception as e:
log.error("[audit] conversations_history failed for %s/%s: %s", ...)
break
if history is None:
return results
코드 리뷰 결과
클린 패스. 80점 이상 이슈 없음.
80점 미달 관찰 2건 (비블로킹):
- _scan_channel limit=100 유지 — mention_scan이 HAN-514에서 50으로 줄인 것과 비대칭. follow-up 가능
- spec_gate_startup_catchup retry 소진 시 outer 루프 break — 기존 동작과 동일(회귀 아님), 관찰성 개선 여지
Result
완료된 것
- [x]
audit.py_scan_channelIncompleteRead retry - [x]
bridge.pyfetch_channel_contextIncompleteRead catch - [x]
bridge.pyspec_gate_startup_catchupIncompleteRead retry - [x] 테스트 15개 통과
- [x] PR #274 squash merge
배운 것
mention_scan경로(retry+limit 감소)와_scan_channel경로(retry만)의 비대칭이 재발 원인- IncompleteRead는 채널 누적 메시지 증가로 반복 발생 추세 — limit 감소 follow-up 고려
링크
- PR: https://github.com/hangseung/pantheon/pull/274
- Linear: https://linear.app/hangman-lab/issue/HAN-600
- Merge commit:
209f11f55958c12e4fb588020f1b805f83d0daec