Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:42 evey Hermes plugins proactive nudge

From Leeroopedia
Knowledge Sources
Domains Proactive_Comunication, Interruption_Management, User_Experience
Last Updated 2026-10-29 00:00 GMT

Overview

Concrete tool for sending proactive messages to the user with an interruption budget (max 4/day), cooldown enforcement, and work-hours awareness.

Description

The proactive_nudge handler (handle_nudge) lets the agent surface observations, tips, and findings without being asked. It enforces three constraints (skipped when urgent=True):

  1. Work hours: Only sends during configured work hours (env WORK_HOURS, default "9-21", supports overnight windows like "22-6").
  2. Daily budget: Max 4 proactive messages per day.
  3. Cooldown: 45-minute cooldown between messages. If the user doesn't respond, cooldown doubles (up to state max).

State is persisted to ~/.hermes/workspace/manager/proactive-state.json and resets daily. The proactive_budget tool (handle_budget) queries remaining budget and cooldown status without sending.

Categories: insight, tip, alert, observation, research_finding.

Usage

Call proactive_nudge when you discover something the user should know about (not as a reply). Call proactive_budget to check remaining budget. Registered on the evey_proactive toolset.

Code Reference

Source Location

  • Repository: hermes-plugins
  • File: evey-proactive/__init__.py
  • Lines: L43-223 (_tz L43-49, _work_hours L56-65, _is_work_hours L68-73, _load_state L76-89, _save_state L92-94, handle_nudge L133-187, handle_budget L190-206, schemas L97-130)

Signature

def handle_nudge(args: dict, **kwargs) -> str:
    """
    Args:
        args: {
            category: str (required, enum: insight/tip/alert/observation/research_finding),
            message: str (required, <100 words),
            urgent: bool - bypasses budget/cooldown (use for service down, security alerts)
        }
    Returns:
        JSON: {status: "sent"/"blocked", category, budget_remaining, next_available_in, instruction}
              or {status: "blocked", reason}
    """

def handle_budget(args: dict, **kwargs) -> str:
    """
    No args. Returns budget status: date, messages_sent, budget_remaining,
    cooldown_minutes, cooldown_remaining_minutes, work_hours, can_send, history.
    """

def _is_work_hours() -> bool:
    """Check if current hour is within configured work hours."""

def _load_state() -> dict:
    """Load proactive state, resetting if date changed."""

def _save_state(state: dict) -> None:
    """Save proactive state to disk."""

Import

from evey_proactive import handle_nudge, handle_budget
# Or accessed via Hermes tool calls: proactive_nudge, proactive_budget

I/O Contract

Inputs (proactive_nudge)

Name Type Required Description
category str Yes One of: insight, tip, alert, observation, research_finding
message str Yes Message to send (keep under 100 words)
urgent bool No Bypass budget and cooldown (default false)

Outputs (proactive_nudge)

Name Type Description
status str "sent" or "blocked"
reason str Present when blocked (outside hours, budget exhausted, cooldown active)
budget_remaining int Messages left today (0-4)
next_available_in str Cooldown duration string
instruction str Tells agent to relay the message to the user

Usage Examples

Sending a Proactive Insight

result = tool_call("proactive_nudge", {
    "category": "insight",
    "message": "I noticed your API costs dropped 30% after switching to the local model for research tasks."
})
# {"status":"sent","category":"insight","budget_remaining":3,
#  "next_available_in":"45 minutes",
#  "instruction":"Now send this message to the user on their messaging channel..."}

Urgent Alert (Bypasses Budget)

result = tool_call("proactive_nudge", {
    "category": "alert",
    "message": "The main API is returning 500 errors. Investigation needed.",
    "urgent": True
})
# Always {"status":"sent",...} regardless of budget/cooldown/hours

Checking Budget

result = tool_call("proactive_budget", {})
# {"date":"2026-10-29","messages_sent":2,"budget_remaining":2,
#  "cooldown_minutes":45,"cooldown_remaining_minutes":12,
#  "work_hours":true,"can_send":false,"history":[...]}

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment