fix(archivar): ContextVar→global dict, asyncio.to_thread, EMBEDDING_BASE_URL, FAISS_AUTO_ROUTE=0.55

- adapter.py: ContextVars durch globales _room_context dict + threading.Lock ersetzt
  (Agent-Task sieht jetzt Archivar-Zielraum — kein error-not-allowed mehr)
- adapter_integration.py: Stay-Feedback-Handler leert thematic_target
  (verhindert dass nächster Send auf alten Archivar-Vorschlag fällt)
- classifier.py: _llm_raw() nutzt asyncio.to_thread() statt direktem await
  (LLMClient.generate() ist synchron — vorher TypeError)
- config.py: ARCHIVAR_EMBEDDING_BASE_URL trennt Embeddings von Chat-URL
  (OLLAMA_BASE_URL-Kollision behoben). FAISS_AUTO_ROUTE 0.70→0.55
  (mehr Nachrichten durch Booster statt direktem FAISS-Routing)
This commit is contained in:
Bernd (Hermes)
2026-06-19 09:09:17 +02:00
parent d005eb769d
commit 0e13e4b30d
4 changed files with 95 additions and 53 deletions
+4 -2
View File
@@ -488,7 +488,8 @@ class IntentClassifier:
Intent-Kategorien. Uses ``LLMClient.generate()`` for free-form
output. Used by the router for LLM_ROOM_PROMPT.
Async because OllamaLLMClient.generate() is async.
Uses ``asyncio.to_thread()`` because ``LLMClient.generate()`` is
synchronous.
Args:
prompt: The complete prompt to send.
@@ -499,7 +500,8 @@ class IntentClassifier:
try:
if not self._llm_client or not self._llm_enabled:
return None
return await self._llm_client.generate(prompt)
import asyncio
return await asyncio.to_thread(self._llm_client.generate, prompt)
except Exception as e:
logger.warning("LLM raw call failed: %s", e)
return None