feat(nav): enforce strict embedding length guards and autonomous brain-first navigation

This commit is contained in:
2026-04-27 23:09:22 +02:00
parent ee3de811d3
commit 7277f27fae
4 changed files with 62 additions and 106 deletions

View File

@@ -125,10 +125,10 @@ class QdrantBase:
if key:
headers["Authorization"] = f"Bearer {key}"
# OpenAI/OpenRouter use 'input' instead of 'prompt'
payload = {"model": model, "input": str(text)[:8000]}
payload = {"model": model, "input": str(text)[:2000]}
else:
# Local Ollama
payload = {"model": model, "prompt": str(text)[:8000]}
payload = {"model": model, "prompt": str(text)[:2000]}
# Log to prevent user from thinking the bot is hung during model swap in VRAM
if not getattr(self, "_has_logged_embedding", False):
@@ -361,7 +361,7 @@ class UIMemoryDB(QdrantBase):
sig = re.sub(r"\s+", " ", sig).strip()
# 3. Strict truncation for nomic-embed-text context window
return sig[:4000]
return sig[:2000]
def _deterministic_id(self, intent: str) -> str:
"""