diff --git a/harness/scheduler.py b/harness/scheduler.py index 6c81241..eac619a 100644 --- a/harness/scheduler.py +++ b/harness/scheduler.py @@ -740,8 +740,13 @@ def _reflex_tick(level_cfg, seq: int, model: dict): period = datetime.fromtimestamp(seq * level_cfg.every, tz=timezone.utc) payload = {"level": "sec", "seq": seq, "load1": load, "ts": period.isoformat()} - # алерт-порог из policy (по умолчанию 8 — как simbiotd) - thr = (model.get("policy") or {}).get("cpu_alert_threshold", 8) + # алерт-порог: по умолчанию 0.75*nproc (16 ядер → 12; t-261012090606), + # policy cpu_alert_threshold переопределяет при наличии + try: + _default_thr = max(8.0, 0.75 * os.cpu_count()) + except Exception: + _default_thr = 12.0 + thr = (model.get("policy") or {}).get("cpu_alert_threshold", _default_thr) if load is not None and load >= thr: payload["alert"] = f"load {load:.2f} >= {thr}" # без-LLM команды: отвечаем на входящие-команды без ответа