mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-04 15:49:45 +08:00
`graphrag_llm` calls `nest_asyncio2.apply()` at import time, and that patch refuses uvloop — the loop `uvicorn[standard]` gives the backend on macOS/Linux. So the first GraphRAG import raised "Can't patch loop of type <class 'uvloop.Loop'>" and indexing died before it started; the reporter's workaround was to force UVICORN_LOOP=asyncio for the whole app. Drive every GraphRAG entry point from a worker thread that owns a stock asyncio loop: the import-time patch and GraphRAG's own nested `run_until_complete` calls get the reentrant loop they expect, and the server's loop is left alone. The adapter stays the only graphrag-aware module, so its function-local imports now also decide where that patch lands. Completes #695 — the settings.yaml `$` escape and the `cache.type` fix landed in #699.