fix(archivar): correct Coroutine-Bug root cause — _llm_raw_sync→async _llm_raw, direct await

OllamaLLMClient.generate() is async def — run_in_executor cannot
correctly execute async functions. The coroutine was never awaited.

Also fix Move-Request parser: native button '1️⃣ Rüber' was not
matched against '1️⃣' — fell through to 'stay' instead of 'move'.

- classifier.py: _llm_raw_sync → async _llm_raw, await generate()
- router.py: remove run_in_executor, direct await _llm_raw()
- adapter.py: normalize MOVE_REQ choice (extract leading digit/emoji)
This commit is contained in:
Bernd (Hermes)
2026-06-17 22:01:45 +02:00
parent 27b117e151
commit 3fe2dd832e
3 changed files with 10 additions and 6 deletions
+1 -4
View File
@@ -598,10 +598,7 @@ class BidirectionalRouter:
# Try LLM — expects room ID directly
# Semaphore schützt vor parallelen Ollama-Aufrufen (qwen2.5:7b = single-request)
async with self._llm_semaphore:
loop = asyncio.get_running_loop()
llm_result = await loop.run_in_executor(
None, self._classifier._llm_raw_sync, prompt
)
llm_result = await self._classifier._llm_raw(prompt)
if llm_result is None:
return None, True # LLM-Aufruf fehlgeschlagen