#Implementing "High-Agency" Proactive Notifications

1 messages · Page 1 of 1 (latest)

keen sorrel
#

I'm trying to evolve my OpenClaw setup into a true 'Chief of Staff' model. Currently, I'm limited by the reply-based nature of the Discord integration.

I want my agent to be able to proactively notify me when:
A long-running background task (like a web crawl or data analysis) finishes.
A scheduled event or 'heartbeat' trigger occurs.
A 'Pending Action' from a previous session needs follow-up.

Basically, I want the agent to be able to 'wake up' and message me first without me having to ping it. Is there a recommended way to handle this? I've considered cron jobs triggering API calls, but I'm looking for the 'OpenClaw way' to handle state-based proactive messaging. Any tips on the best architecture for this?

vital frigateBOT
crimson elmBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

vital frigateBOT
crisp zodiacBOT
#

Yes, this is very much doable, and the “OpenClaw way” is basically:

  1. Cron / Heartbeat decide when to wake
  2. Background Tasks track detached work
  3. Direct delivery or heartbeat wake notifies you
  4. Hooks / webhooks bridge external state into the Gateway

So for your cases:

  • Long-running crawl / analysis finishes
    Start it as detached OpenClaw work, for example isolated cron, subagent, ACP, or background exec. That creates a task record, and when it finishes OpenClaw can either:

    • deliver directly to Discord, or
    • queue a system event and wake heartbeat immediately
  • Scheduled event / heartbeat trigger
    Use:

    • Cron for exact timing, daily brief at 8:00, reminder in 20m, etc.
#
  • Heartbeat for “Chief of Staff” style periodic awareness, inbox checks, pending follow-ups, calendar nudges

  • Pending action from a previous session
    This is usually best as heartbeat + a state store.
    Important nuance, OpenClaw gives you the wake/delivery machinery, but you still need a source of truth for “pending actions”, for example:

    • HEARTBEAT.md
    • a small JSON/DB/file your hooks update
    • task metadata / your own queue

Recommended architecture

  • Heartbeat = periodic review loop
    Set agents.defaults.heartbeat.target: "last" (or explicit Discord target) so it can message first.
  • Cron = exact-time reports/reminders
    Use openclaw cron add ... --announce --channel discord --to "channel:<id>"
  • Tasks = completion tracking
    Detached work should create a task, then let OpenClaw push completion instead of polling.
#
  • Hooks/webhooks = state/event ingestion
    External systems should call the Gateway via /hooks/wake or /hooks/agent, not Discord/model APIs directly.

The key mental model

Don’t think “Discord bot that only replies”.
Think “Gateway with schedulers, task ledger, and delivery routing that happens to use Discord as one output surface.”

Good defaults

For a proactive setup, I’d start with:

{
  agents: {
    defaults: {
#
      heartbeat: {
        every: "30m",
        target: "last",
        lightContext: true,
        isolatedSession: true
      }
    }
  }
}

Then:

  • put your follow-up logic in HEARTBEAT.md
  • run exact reminders/reports via cron
  • launch long jobs as detached tasks, not ad hoc external scripts