diff --git a/troubleshooting/250806_happybell80_함수형전환과LLM메모리선택.md b/troubleshooting/250806_happybell80_함수형전환과LLM메모리선택.md index 6f5a1fd..9a87eb9 100644 --- a/troubleshooting/250806_happybell80_함수형전환과LLM메모리선택.md +++ b/troubleshooting/250806_happybell80_함수형전환과LLM메모리선택.md @@ -113,6 +113,33 @@ app/core/memory.py (I/O 레이어) - ✅ 함수형 100% 달성 - ✅ 하드코딩 0% +## 다음날 오전 10시 00분 + +### await 누락 버그 발견 + +**증상** +``` +[메모리] 검색 실패: object of type 'coroutine' has no len() +RuntimeWarning: coroutine 'adaptive_memory_selection' was never awaited +``` + +**원인** +```python +# 잘못된 코드 (await 누락) +filtered_memories = adaptive_memory_selection(query, memories, mistral_key) + +# 수정된 코드 +filtered_memories = await adaptive_memory_selection(query, memories, mistral_key) +``` + +**영향** +- Mistral API 호출 안됨 +- LLM 기반 메모리 선택 실패 +- 폴백 로직도 작동 안함 + +**해결** +- 단순 await 누락 - 1줄 수정으로 해결 + ## 교훈 1. **Fire & Forget은 위험하다** @@ -137,6 +164,11 @@ app/core/memory.py (I/O 레이어) - 테스트 용이성 - 재사용 가능 +6. **async/await 실수 방지** + - async 함수는 반드시 await와 함께 + - IDE 경고 무시하지 말 것 + - coroutine 에러 = await 누락 의심 + --- 작성자: happybell80 & Claude