superlocalmemory 3.4.33 → 3.4.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +58 -0
- package/package.json +1 -1
- package/pyproject.toml +1 -1
- package/src/superlocalmemory/__init__.py +1 -1
- package/src/superlocalmemory/cli/commands.py +2 -2
- package/src/superlocalmemory/cli/setup_wizard.py +6 -6
- package/src/superlocalmemory/core/config.py +31 -3
- package/src/superlocalmemory/core/queue_consumer.py +168 -0
- package/src/superlocalmemory/core/recall_queue.py +16 -9
- package/src/superlocalmemory/hooks/auto_recall_hook.py +215 -0
- package/src/superlocalmemory/hooks/hook_handlers.py +3 -0
- package/src/superlocalmemory/mcp/tools_v3.py +14 -2
- package/src/superlocalmemory/server/routes/v3_api.py +1 -1
- package/src/superlocalmemory/server/unified_daemon.py +35 -0
- package/src/superlocalmemory.egg-info/PKG-INFO +0 -663
- package/src/superlocalmemory.egg-info/SOURCES.txt +0 -448
- package/src/superlocalmemory.egg-info/dependency_links.txt +0 -1
- package/src/superlocalmemory.egg-info/entry_points.txt +0 -2
- package/src/superlocalmemory.egg-info/requires.txt +0 -59
- package/src/superlocalmemory.egg-info/top_level.txt +0 -1
|
@@ -422,6 +422,27 @@ async def lifespan(application: FastAPI):
|
|
|
422
422
|
logger.warning("Embedding warmup failed: %s", exc)
|
|
423
423
|
threading.Thread(target=_warmup_embedder, daemon=True, name="embed-warmup").start()
|
|
424
424
|
|
|
425
|
+
# v3.4.26: Start QueueConsumer — drains recall_queue.db via pool.recall().
|
|
426
|
+
# Must start AFTER WorkerPool.warmup() so the worker is ready.
|
|
427
|
+
try:
|
|
428
|
+
from pathlib import Path as _QP
|
|
429
|
+
from superlocalmemory.core.queue_consumer import QueueConsumer
|
|
430
|
+
from superlocalmemory.core.recall_queue import RecallQueue
|
|
431
|
+
_queue_db = _QP.home() / ".superlocalmemory" / "recall_queue.db"
|
|
432
|
+
_recall_queue = RecallQueue(_queue_db)
|
|
433
|
+
_queue_consumer = QueueConsumer(
|
|
434
|
+
queue=_recall_queue,
|
|
435
|
+
pool=WorkerPool.shared(),
|
|
436
|
+
)
|
|
437
|
+
_queue_consumer.start()
|
|
438
|
+
application.state.queue_consumer = _queue_consumer
|
|
439
|
+
application.state.recall_queue = _recall_queue
|
|
440
|
+
logger.info("QueueConsumer started (recall_queue.db)")
|
|
441
|
+
except Exception as _qc_exc:
|
|
442
|
+
logger.warning("QueueConsumer start failed (non-fatal): %s", _qc_exc)
|
|
443
|
+
application.state.queue_consumer = None
|
|
444
|
+
application.state.recall_queue = None
|
|
445
|
+
|
|
425
446
|
except Exception as exc:
|
|
426
447
|
logger.warning("Engine init failed: %s", exc)
|
|
427
448
|
application.state.engine = None
|
|
@@ -571,6 +592,20 @@ async def lifespan(application: FastAPI):
|
|
|
571
592
|
except Exception as exc: # pragma: no cover — defensive
|
|
572
593
|
logger.warning("bandit_tasks cancel failed: %s", exc)
|
|
573
594
|
|
|
595
|
+
# v3.4.26: Stop QueueConsumer (recall_queue.db drainer).
|
|
596
|
+
_qc = getattr(application.state, "queue_consumer", None)
|
|
597
|
+
if _qc is not None:
|
|
598
|
+
try:
|
|
599
|
+
_qc.stop()
|
|
600
|
+
except Exception as exc: # pragma: no cover — defensive
|
|
601
|
+
logger.warning("queue_consumer stop failed: %s", exc)
|
|
602
|
+
_rq = getattr(application.state, "recall_queue", None)
|
|
603
|
+
if _rq is not None:
|
|
604
|
+
try:
|
|
605
|
+
_rq.close()
|
|
606
|
+
except Exception as exc: # pragma: no cover — defensive
|
|
607
|
+
logger.warning("recall_queue close failed: %s", exc)
|
|
608
|
+
|
|
574
609
|
# Stop HealthMonitor (health_monitor.py owns a daemon thread).
|
|
575
610
|
_health = getattr(application.state, "health_monitor", None)
|
|
576
611
|
if _health is not None:
|