chore: auto-commit from dashboard
This commit is contained in:
@@ -25,7 +25,7 @@
|
||||
}
|
||||
},
|
||||
"heartbeat": {
|
||||
"enabled": true,
|
||||
"enabled": false,
|
||||
"interval_minutes": 120,
|
||||
"channel": "echo-core",
|
||||
"model": "haiku",
|
||||
@@ -34,7 +34,7 @@
|
||||
"email": true,
|
||||
"calendar": true,
|
||||
"kb_index": true,
|
||||
"git": true
|
||||
"git": false
|
||||
},
|
||||
"cooldowns": {
|
||||
"email": 1800,
|
||||
|
||||
@@ -53,6 +53,9 @@ def run_heartbeat(config: dict | None = None) -> str:
|
||||
hour = datetime.now().hour # local hour
|
||||
is_quiet = _is_quiet_hour(hour, quiet_hours)
|
||||
|
||||
if is_quiet:
|
||||
return "HEARTBEAT_OK"
|
||||
|
||||
state = _load_state()
|
||||
checks = state.setdefault("checks", {})
|
||||
results = []
|
||||
@@ -65,8 +68,8 @@ def run_heartbeat(config: dict | None = None) -> str:
|
||||
results.append(email_result)
|
||||
checks["email"] = now.isoformat()
|
||||
|
||||
# Check 2: Calendar — daily summary + next-event reminder (no quiet hours bypass)
|
||||
if check_flags.get("calendar") and not is_quiet and _should_run("calendar", checks, now, cooldowns):
|
||||
# Check 2: Calendar — daily summary + next-event reminder
|
||||
if check_flags.get("calendar") and _should_run("calendar", checks, now, cooldowns):
|
||||
cal_result = _check_calendar_smart(state, quiet_hours)
|
||||
if cal_result:
|
||||
results.append(cal_result)
|
||||
@@ -94,10 +97,7 @@ def run_heartbeat(config: dict | None = None) -> str:
|
||||
checks["embeddings"] = now.isoformat()
|
||||
|
||||
# Claude CLI: run if HEARTBEAT.md has extra instructions
|
||||
if not is_quiet:
|
||||
claude_result = _run_claude_extra(
|
||||
hb_config, critical + results, is_quiet
|
||||
)
|
||||
claude_result = _run_claude_extra(hb_config, critical + results)
|
||||
if claude_result:
|
||||
results.append(claude_result)
|
||||
|
||||
@@ -105,12 +105,6 @@ def run_heartbeat(config: dict | None = None) -> str:
|
||||
state["last_run"] = now.isoformat()
|
||||
_save_state(state)
|
||||
|
||||
# Critical items always get through (even quiet hours)
|
||||
if is_quiet:
|
||||
if critical:
|
||||
return " | ".join(critical)
|
||||
return "HEARTBEAT_OK"
|
||||
|
||||
all_results = critical + results
|
||||
if not all_results:
|
||||
return "HEARTBEAT_OK"
|
||||
@@ -408,8 +402,7 @@ def _get_extra_instructions() -> str | None:
|
||||
return "\n".join(meaningful).strip()
|
||||
|
||||
|
||||
def _run_claude_extra(hb_config: dict, python_results: list[str],
|
||||
is_quiet: bool) -> str | None:
|
||||
def _run_claude_extra(hb_config: dict, python_results: list[str]) -> str | None:
|
||||
"""Run Claude CLI if HEARTBEAT.md has extra instructions."""
|
||||
from src.claude_session import CLAUDE_BIN, _safe_env
|
||||
|
||||
@@ -457,7 +450,7 @@ def _run_claude_extra(hb_config: dict, python_results: list[str],
|
||||
return None
|
||||
data = json.loads(proc.stdout)
|
||||
result = data.get("result", "").strip()
|
||||
if not result or result == "HEARTBEAT_OK":
|
||||
if not result or "HEARTBEAT_OK" in result:
|
||||
return None
|
||||
return result
|
||||
except subprocess.TimeoutExpired:
|
||||
|
||||
@@ -94,7 +94,7 @@ def main():
|
||||
try:
|
||||
result = await asyncio.to_thread(run_heartbeat, config)
|
||||
logger.info("Heartbeat: %s", result)
|
||||
if result != "HEARTBEAT_OK":
|
||||
if result and "HEARTBEAT_OK" not in result:
|
||||
await _send_to_channel(hb_channel, result)
|
||||
except Exception as exc:
|
||||
logger.error("Heartbeat failed: %s", exc)
|
||||
|
||||
Reference in New Issue
Block a user