hermes-agent/tests/cron
Teknium a06b997158
feat: script gate for cron jobs (port from nanoclaw #1232)
Add optional 'script' field to cron jobs. Before waking the agent, the
script runs as bash with a 30s timeout. Its last stdout line is parsed
as JSON:
  {"wakeAgent": false}          -> skip the agent entirely
  {"wakeAgent": true, "data": ...} -> prepend data to agent prompt

This enables frequent cron schedules (every 1-10 min) without API cost.
E.g., a script checks if a GitHub PR has new comments — only wakes the
agent when there's actually something to do.

Graceful fallback: script errors, timeouts, or invalid JSON all log a
warning and proceed normally (never block the agent).

Inspired by qwibitai/nanoclaw#1232.

15 new tests covering all paths.
2026-03-29 17:57:52 -07:00
..
__init__.py test: add unit tests for 8 modules (batch 2) 2026-02-26 13:54:20 +03:00
test_jobs.py fix(cron): prevent recurring job re-fire on gateway crash/restart loop (#3396) 2026-03-27 08:02:58 -07:00
test_scheduler.py feat(cron): add cron.wrap_response config to disable delivery wrapping (#3807) 2026-03-29 16:31:01 -07:00
test_script_gate.py feat: script gate for cron jobs (port from nanoclaw #1232) 2026-03-29 17:57:52 -07:00