It keeps doing the same problems for math
complete
S
Student be3ff24b-29b
Category:
Quizzes & PracticeType:
User submissionUser role:
studentP
Patrick Jean
marked this post as
complete
P
Parent 019d2c96-a3c
Investigation Summary - Repeated Math Problems
Root Cause (FIXED in PR #1027):
The quiz diversity service in backend/learning/quiz_diversity.py
had a hardcoded 2-second timeout on Cerebe memory searches. When the timeout was hit (common under load), the service silently returned an empty exclusion list — meaning the LLM generated quizzes with zero awareness of previously seen items.Fix applied:
PR #1027 (merged April 4, 2026) increased the timeout from 2s to 10s (configurable via QUIZ_MEMORY_SEARCH_TIMEOUT_S
env var), added proper error logging, and defensive env var parsing.Remaining risks:
- If Cerebe is down, items are not stored so dedup context is missing
- If memory search still times out at 10s, quiz proceeds without dedup
- Only last 5 quiz memories are retrieved (could miss items from rapid switching)
Recommendation:
Monitor logs for "quiz_diversity: memory search timed out" to verify the fix is effective. This bug should be resolved for most users.---
Investigated by Claude Code automated bug investigator