Skip to content

Add real-time monitoring: healthchecks, ntfy, GitHub heartbeat#8

Draft
nkhdiscovery wants to merge 1 commit intomainfrom
claude/add-heartbeat-tracking-4E0E7
Draft

Add real-time monitoring: healthchecks, ntfy, GitHub heartbeat#8
nkhdiscovery wants to merge 1 commit intomainfrom
claude/add-heartbeat-tracking-4E0E7

Conversation

@nkhdiscovery
Copy link
Copy Markdown
Owner

What this does

Adds three optional monitoring integrations to the agent launcher, enabling real-time visibility into agent health and activity without opening GitHub:

  1. healthchecks.io dead-man's switch: Agent pings a URL each cycle; alerts if pings stop for >2× idle period
  2. ntfy.sh push notifications: Cycle start/end/failure messages to your phone (free, no account needed)
  3. GitHub-native heartbeat: Updates .agent/heartbeat via API each cycle for zero external dependencies

All three are opt-in via .env variables and gracefully no-op if unconfigured. The launcher now loads .env before sourcing agent runtime, enabling these integrations.

Changes

  • scripts/launch-agent.sh:

    • Load .env early to provide HEALTHCHECKS_URL, NTFY_TOPIC, NTFY_SERVER, AGENT_GITHUB_HEARTBEAT
    • Add hc_ping(), ntfy_push(), hb_commit() helper functions
    • Call hc_ping() and hb_commit() at cycle start
    • Send ntfy notifications on cycle start (with work description), success, and failure
    • Fetch cost data and include in notifications
  • .env.example: Document all four new monitoring variables with setup instructions and trade-offs

  • Makefile: Add agent-status target showing container state, last log activity, and today's cost

  • README.md: New "Real-time monitoring (opt-in)" section explaining each integration, setup, and trade-offs

Issue / deliverable

Improves observability for long-running agent instances without requiring external infrastructure.

Checklist

  • make ci passes locally
  • No secrets, API keys, or personal data in diff
  • Docs updated (README, .env.example, Makefile help)
  • All integrations gracefully no-op if unconfigured

Risk / blast radius

Low. All new code is additive and guarded by environment variable checks. Existing agent cycle logic unchanged; monitoring calls are fire-and-forget with || true fallbacks. No breaking changes to configuration or behavior.

https://claude.ai/code/session_011xVoqL8J3Np2di1FUGHdk5

… heartbeat)

Adds two-layer observability for solo founders running the agent 24/7:

- Liveness (dead-man's switch): agent pings HEALTHCHECKS_URL at the start
  of every cycle; if pings stop for >2× idle sleep, healthchecks.io fires
  an alert. One env var, one curl call in the loop.

- Activity (push notifications): ntfy_push() posts ▶/✓/⚠ messages to
  NTFY_TOPIC each cycle via ntfy.sh. Shows what's being worked on, cycle
  cost, and non-zero exits. No account required.

- GitHub-native heartbeat: hb_commit() updates .agent/heartbeat via the
  GitHub API each cycle when AGENT_GITHUB_HEARTBEAT=1. Appears in mobile
  activity feed with zero external dependencies.

All signals are fully opt-in — unset env vars are no-ops. .env.example
documents each var with setup notes. README gets a "Real-time monitoring"
section. Makefile gains `make agent-status` showing container state, last
log activity, and today's cost.

https://claude.ai/code/session_011xVoqL8J3Np2di1FUGHdk5
@nkhdiscovery nkhdiscovery marked this pull request as draft April 30, 2026 07:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants