You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
app: /chat non-blocking maken (run_in_threadpool rond Mistral-call) — event loop blokkeert nu tot 180s #80
async def chat in app/main.py roept de blocking mistral_client.answer_question(...) (requests.post, timeout=180s) direct aan in de event loop. Met 1 uvicorn-worker blokkeert één trage agent-run de hele app: gemeten — een GET /healthz 1s na een gemockte 8s /chat duurde 7,0s in plaats van ~0s. Alle gelijktijdige requests (ook andere gebruikers) schuiven aan en halen de proxy-timeout niet.
Gewenst
Draai de Mistral-call off-loop: await run_in_threadpool(mistral_client.answer_question, ...) (starlette.concurrency) of schakel mistral_client om naar httpx AsyncClient. Kies één van beide consequent.
Idem voor check_reachable in /healthz (blocking requests.get, timeout=10s).
DEFAULT_TIMEOUT = 180 in app/mistral_client.py blijft de backstop.
Acceptatiecriteria
Nieuwe test in app/tests/test_app.py: tijdens een gemockte trage answer_question (bv. 5s) reageert een gelijktijdige GET /healthz (gemockt, instant) binnen ~1s.
Alle bestaande tests in app/tests/ groen (pytest app/tests).
Handmatige check: twee gelijktijdige /chat-vragen in de lokale dev-server blokkeren elkaar niet meer.
Context
Gemeten in de diagnose van #78 (2026-11-13). Dit ticket blokkeert het 202/status-ticket voor echte voortgangsstappen in de UI.
Activity
app: /chat en /healthz non-blocking maken via run_in_threadpool (#80)
Atrium0804 commentedon Nov 13, 2026
Implemented in commits 3f567c5 (#81-84) and 049878b (#85); #80 was al geland in feb92a6. Alle tests groen (274 Python + 42 JS DOM).