diff --git a/src/main.py b/src/main.py index 4bb3936..9a32dac 100644 --- a/src/main.py +++ b/src/main.py @@ -175,6 +175,25 @@ async def lifespan(app: FastAPI): db_path=default_db_path, ) + # ── 集成模块 ── + # HealthChecker(僵尸检测) + health_checker = HealthChecker( + zombie_threshold=daemon_config.get("zombie_threshold", 20), + ) + + # ExperienceDistiller(经验自动蒸馏) + experience_config = config.get("experience", {}) + experience_distiller = ExperienceDistiller( + store=ExperienceStore(store_path=DATA_ROOT / "experiences.jsonl"), + ) + + # InboxWatcher(即时事件监听) + inbox_config = config.get("inbox", {}) + inbox_watcher = InboxWatcher( + inbox_path=DATA_ROOT / inbox_config.get("path", "inbox/daemon.jsonl"), + watch_interval=inbox_config.get("watch_interval", 1.0), + ) + ticker = Ticker( registry=registry, tick_interval=tick_interval, @@ -183,6 +202,9 @@ async def lifespan(app: FastAPI): max_dispatch_per_tick=max_dispatch, claim_timeout_minutes=claim_timeout, default_task_timeout_minutes=task_timeout, + health_checker=health_checker, + experience_distiller=experience_distiller, + inbox_watcher=inbox_watcher, ) await ticker.start() agent_ids = list(agent_profiles.keys())