From 1c1934e19842836ad4ac5904eff290975f20d8d2 Mon Sep 17 00:00:00 2001 From: happybell80 Date: Thu, 7 Aug 2025 00:21:49 +0900 Subject: [PATCH] =?UTF-8?q?docs:=20await=20=EB=88=84=EB=9D=BD=20=EB=B2=84?= =?UTF-8?q?=EA=B7=B8=20=EB=B0=8F=20=EA=B5=90=ED=9B=88=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...80_함수형전환과LLM메모리선택.md | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) 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