Files
MoFin/scripts/trigger_weekend_jobs.py
T
hmo 10a37f10f9 fix(watchdog): gateway session check now uses agent.log scan, not live LLM ping
Gateway看门狗-知微 was erroring (exit -15): its check_session_health did a
live LLM ping with 25s timeout. Cold-start LLM latency is 20-100s so the
ping always timed out -> false '不健康' verdict -> false gateway restart
-> and each 10-min run burned 22k tokens.

Now uses xmpp_logger._scan_agent_log (zero cost, reads real call results):
- ok if last real call succeeded
- unhealthy only if last call explicitly failed
- idle (no recent calls) counts as healthy
Verified: watchdog job now status=ok.

Also: triggered all 6 weekend 'Blocked' jobs via hermes cron run — all
now status=ok, proving the hardlink fix holds.
2026-07-20 20:55:30 +08:00

15 lines
795 B
Python

import json, subprocess
d = json.load(open('/home/hmo/.hermes/profiles/position-analyst/cron/jobs.json'))
jobs = d if isinstance(d, list) else d.get('jobs', [])
targets = ['策略评估-每周', '建议对账-每周', '数据治理-每周',
'跨市场背离检测-周末', '自选股自动重评-周末', 'state.db真空整理-每周']
for j in jobs:
if j.get('name') in targets:
jid = j.get('id')
print(f"triggering: {j['name']} (id={jid})")
r = subprocess.run(['/home/hmo/hermes-agent/.venv/bin/python', '-m', 'hermes_cli.main',
'-p', 'position-analyst', 'cron', 'run', jid],
capture_output=True, text=True, timeout=30)
out = (r.stdout + r.stderr).strip()[:150]
print(f' -> {out}')