# No-Agent Cron Job Pattern ## Problem LLM-driven cron jobs (even simple ones like "ping router and report") use an LLM on every tick — wasting tokens, adding latency, and most importantly causing the **phantom typing indicator** in Telegram. The user sees "agent is typing..." every few minutes even for trivial watchdog checks. ## Solution: no_agent=true When the cron job's task is a deterministic script check (ping, port test, service status, file check, API test), set `no_agent=true`. The script runs standalone — no LLM invoked, no typing indicator, zero tokens. ### Design pattern The script must: 1. Exit 0 (silent) when everything is fine — **no output at all** means no delivery 2. Print an error message and exit non-zero when something is wrong — `stdout` becomes the delivered alert 3. Need no LLM reasoning to compose the output ### Implementation ```bash cronjob action=update job_id= no_agent=true prompt="" script= ``` The `prompt` is **ignored** when `no_agent=true`. Only the script's `stdout` (on non-zero exit) is delivered. ### Watchdog script template ```bash #!/bin/bash # watchdog.sh — Silent on success, alert on failure # Runs via no_agent cron TARGET="10.77.0.2" SUCCESS=0 for i in 1 2 3; do if ping -c 1 -W 3 "$TARGET" >/dev/null 2>&1; then SUCCESS=$((SUCCESS + 1)) [ "$SUCCESS" -ge 2 ] && exit 0 # silent fi sleep 5 done echo "[-] $TARGET unreachable after 3 attempts" exit 1 ``` ### When NOT to use no_agent - The cron produces raw data that needs narrative synthesis (daily digest, tech briefing) - Multiple data sources need correlation before alerting - The output format must be platform-specific (e.g. HTML email) - A decision must be made from the data (e.g. "is this spike routine maintenance or a problem?") ### Converting existing LLM-driven crons Best candidates: - Watchdog/ping checks - Backup status checks - Bounce detection (scan inbox for bounces, output findings) - Security scans (Lynis, etc.) - Any cron where the output is "up/down" or "ok/fail"