auto-sync: 2026-05-19 23:26:28
This commit is contained in:
@@ -227,8 +227,6 @@ class Dispatcher:
|
||||
agent_id=agent_id,
|
||||
current_status=task.status or "claimed",
|
||||
retry_context=retry_ctx,
|
||||
task=task,
|
||||
project_config=project_config,
|
||||
)
|
||||
# fallback
|
||||
parts = [f"Task: {task.title}"]
|
||||
|
||||
+1
-40
@@ -18,10 +18,6 @@ from src.daemon.spawner import AgentSpawner
|
||||
from src.daemon.dispatcher import Dispatcher
|
||||
from src.daemon.counter import ActiveAgentCounter
|
||||
from src.daemon.router import AgentRouter, AgentProfile, LLMDriver
|
||||
from src.daemon.health import HealthChecker
|
||||
from src.daemon.inbox import InboxWatcher
|
||||
from src.daemon.experience import ExperienceDistiller, ExperienceStore
|
||||
from src.daemon.bootstrap import BootstrapBuilder
|
||||
from src.utils import get_data_root
|
||||
|
||||
logger = logging.getLogger("moziplus-v2")
|
||||
@@ -46,9 +42,7 @@ def _setup_logging():
|
||||
datefmt="%Y-%m-%d %H:%M:%S",
|
||||
))
|
||||
for name in ("moziplus-v2", "moziplus-v2.ticker", "moziplus-v2.spawner",
|
||||
"moziplus-v2.dispatcher", "moziplus-v2.counter",
|
||||
"moziplus-v2.health", "moziplus-v2.inbox",
|
||||
"moziplus-v2.experience", "moziplus-v2.bootstrap"):
|
||||
"moziplus-v2.dispatcher", "moziplus-v2.counter"):
|
||||
lg = logging.getLogger(name)
|
||||
lg.setLevel(logging.INFO)
|
||||
lg.addHandler(handler)
|
||||
@@ -128,10 +122,6 @@ async def lifespan(app: FastAPI):
|
||||
agent_timeout=daemon_config.get("agent_timeout", 600),
|
||||
api_host=api_host,
|
||||
api_port=api_port,
|
||||
bootstrap_builder=BootstrapBuilder(
|
||||
template_dir=Path(__file__).parent / "daemon" / "prompt_templates",
|
||||
max_tokens=4096,
|
||||
),
|
||||
)
|
||||
counter = ActiveAgentCounter(
|
||||
max_global=daemon_config.get("max_global_agents", 5),
|
||||
@@ -182,28 +172,6 @@ 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_store_path = DATA_ROOT / "experiences.jsonl"
|
||||
experience_distiller = ExperienceDistiller(
|
||||
store=ExperienceStore(store_path=experience_store_path),
|
||||
)
|
||||
|
||||
# InboxWatcher
|
||||
inbox_config = config.get("inbox", {})
|
||||
inbox_path = DATA_ROOT / inbox_config.get("path", "inbox/daemon.jsonl")
|
||||
inbox_watcher = InboxWatcher(
|
||||
inbox_path=inbox_path,
|
||||
watch_interval=inbox_config.get("watch_interval", 1.0),
|
||||
# process_callback 在 Ticker.start() 后设置(需要 ticker 引用)
|
||||
)
|
||||
|
||||
ticker = Ticker(
|
||||
registry=registry,
|
||||
tick_interval=tick_interval,
|
||||
@@ -212,14 +180,7 @@ 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,
|
||||
inbox_watcher=inbox_watcher,
|
||||
experience_distiller=experience_distiller,
|
||||
)
|
||||
|
||||
# 绑定 InboxWatcher 回调(需要 ticker 引用)
|
||||
inbox_watcher.process_callback = ticker._on_inbox_event
|
||||
|
||||
await ticker.start()
|
||||
agent_ids = list(agent_profiles.keys())
|
||||
logger.info("Ticker started (interval=%ss, dispatch=%d/tick, agents=%s, llm=%s)",
|
||||
|
||||
Reference in New Issue
Block a user