| name | auto-debug |
| description | 자동 디버깅 — 에러 로그 → 원인 파일/라인 추적, Docker/Python traceback 분석 |
| user_invocable | true |
/auto-debug — 에러 자동 추적
에러가 발생하면 로그를 분석해서 원인을 빠르게 찾습니다.
사용법
/auto-debug last → 최근 Docker 로그 마지막 에러 추적
/auto-debug logs <lines> → 마지막 N줄 로그 분석
/auto-debug telegram → 텔레그램 실패 알림 → 원인 추적
/auto-debug pipeline <topic> → 특정 토픽 생성 실패 재현 + 디버깅
/auto-debug api <endpoint> → API 엔드포인트 응답 분석
분석 흐름
-
로그 수집
docker compose logs backend --tail 200
assets/_analytics/alerts/last_run.json
- 텔레그램 실패 알림 메시지
-
Traceback 파싱
- Python traceback → 파일:라인 자동 추출
- 마지막 stack frame이 모듈 코드인지 확인
- 라이브러리 에러면 user code 호출 지점 추적
-
원인 분류
- 🔴 환경: API 키 / 쿼터 / 네트워크
- 🟡 데이터: 입력값 검증 실패, JSON 파싱
- 🟢 로직: 함수 호출 시그니처, 변수 스코프
- ⚫ 외부: YouTube API, ElevenLabs, Veo3 응답
-
자동 수정 제안
- 단순 typo / import 누락 → 즉시 수정안 제시
- API 응답 변화 → 어댑터 패턴 제안
- 복잡한 로직 → Plan 에이전트로 위임
통합 지점
- 텔레그램:
notify_failure() 호출 시 자동 트리거 가능
- agent_memory: 반복 실패 →
record_failure() 자동 호출
- alert_engine: 아웃라이어 감지 → 디버깅 컨텍스트 첨부
담당 파일
modules/utils/notify.py (실패 알림 메시지 소스)
assets/_analytics/alerts/ (알림 이력)
- Docker logs (
docker compose logs)
modules/agent_memory/ (실패 패턴 기록)
예시 출력
[auto-debug last] Docker 로그 분석 중...
🔴 에러 발견: KeyError: 'channel'
📍 modules/scheduler/auto_deploy.py:413
📍 호출자: api_server.py:run_auto_deploy()
💡 원인: agent_context.get('channel') 호출 전 None 체크 누락
🔧 제안: cuts 결과에 channel 필드 첨부 (cutter/generator.py:325)
📊 빈도: agent_memory에 동일 패턴 3회 기록