fix: support Qdrant backend on non-AVX CPUs

- doctor: skip LanceDB check when qdrant_storage/ dir detected
- topology: use daemon socket instead of local store (avoids lancedb crash)
- qdrant_store: add records_as_dataframe() + wire into _TableShim
  so build_runtime_graph() works with Qdrant (was returning empty)
This commit is contained in:
Apunkt 2026-05-12 18:14:03 +02:00
parent 01e5903035
commit 8492719735
No known key found for this signature in database
3 changed files with 110 additions and 8 deletions

View file

@ -433,7 +433,31 @@ def check_f_lancedb_readable() -> CheckResult:
Open a MemoryStore handle. The constructor opens the lancedb connection;
if the directory is corrupt / permission-denied / disk-full, the
constructor raises and we report FAIL.
Skips gracefully when Qdrant is the active backend or lancedb is
unavailable (non-AVX CPU, etc.) returns PASS with skip reason.
"""
from iai_mcp.store import _use_qdrant
if _use_qdrant():
return CheckResult(
"(f) lancedb store readable",
True,
"skipped (Qdrant backend active)",
)
# Heuristic: qdrant_storage/ directory present → Qdrant is the active
# backend even if QDRANT_URL is not set in the current shell (e.g.
# systemd service provides it but interactive shell does not).
env_path = os.environ.get("IAI_MCP_STORE")
store_root = Path(env_path) if env_path else (Path.home() / ".iai-mcp")
if (store_root / "qdrant_storage").exists():
return CheckResult(
"(f) lancedb store readable",
True,
"skipped (Qdrant backend detected via qdrant_storage/)",
)
try:
from iai_mcp.store import MemoryStore
@ -443,11 +467,24 @@ def check_f_lancedb_readable() -> CheckResult:
True,
"opens without error",
)
except KeyboardInterrupt:
raise
except SystemExit:
raise
except Exception as e: # noqa: BLE001 — surface any open failure
# Non-AVX CPUs may crash in lancedb native libs (SIGILL); treat as
# unavailable rather than a store corruption failure.
exc_name = type(e).__name__
if exc_name == "IllegalInstruction" or "illegal" in str(e).lower():
return CheckResult(
"(f) lancedb store readable",
True,
f"skipped (lancedb unavailable on this CPU: {exc_name})",
)
return CheckResult(
"(f) lancedb store readable",
False,
f"open failed: {type(e).__name__}: {e}",
f"open failed: {exc_name}: {e}",
)