#1 동기 HTTP → async aiohttp (Critical)
- RemoteTransport: urllib.request → aiohttp.ClientSession
- 모든 HTTP 요청이 non-blocking으로 전환
- 이벤트 루프 블로킹 문제 해결
#2 연결 상태 모니터링
- RemoteTransport: connected 플래그 + 연속 실패 카운터
- Collector: 30초마다 health check → 실패 시 경고 로그
- 연결 복구 시 '✅ Gateway connected' 메시지
#3 실패 재시도 큐
- RemoteTransport: _retry_queue (최대 100건)
- POST 실패 시 큐에 저장, 연결 복구 후 자동 재전송
- Collector: 10초마다 retry flush
Bug 1 (만료됨 스팸): Collector 시작 시 기존 pending skip
Bug 2 (pending 미삭제): Gateway에서 response 소비 시 pending도 삭제
Bug 3 (재시작 중복): Bug 1로 해결
Security 1: API 요청 1MB 크기 제한 (client_max_size)
Security 2: IP별 rate limiting (10 req/s)
Security 3: _commands 메모리 누수 방지 (TTL 30분)
Gap 1: Discord→Extension 명령어 깨짐
- bot.py: _write_command() 래퍼 — gateway.push_command()도 호출
- main.py: bot.gateway 연결
- 슬래시 명령어 + on_message 모두 _write_command 사용
Gap 2: Chat snapshot 미전달
- collector.py: _forward_chat_snapshots_loop 추가
Gap 3: Session registration 미전달
- collector.py: _forward_registrations_loop 추가