Product 11 · SDK / MCP Server / Local API · Wave 2

Heartbeat & Continuity

Agents go quiet. This keeps them honest about it. A paced heartbeat wakes a long-running agent on an interval, reclaims sessions that started but never finished, flags inbound messages it owes a reply to, and stops it from rewriting the same note every cycle.

Wave 2 · v0.1.1 · on npm
← Product 10: Agent Test Harness Next: Product 12 · Wave 2 Recovery Assessment Engine →

Agents don't fail loudly. They go quiet.

Long-running and autonomous agents don't fail loudly — they go quiet. A worker loop starts a session, hits an interruption mid-run, and leaves a running record that never closes. Nothing finishes it, and nothing else can start because the orphaned session still looks live. The agent is neither working nor available, and no operator is watching the exact moment it stalled.

Inbound obligations rot the same way. A message arrives for the agent, delivery is allowed, and the message sits pending while the agent's next cycle "completes" without ever dispositioning it. There is no checkpoint that says: you were handed something, you have not answered it, and you are not allowed to call this cycle done.

And agents that wake on a timer tend to loop. Without a memory of what they already said, each cycle re-consolidates the same motifs as if repetition itself were new progress. The log grows; the information does not. Heartbeat & Continuity adds the missing liveness checkpoint: a paced wake, a stale-session reclaim, an inbound-obligation gate, and a repetition damper.

Wake → Reclaim → Damp

Wake on a paced interval

A worker or scheduler calls trigger_heartbeat (or the gated run_heartbeat_cycle). The server checks the configured interval and an hourly session cap before doing any work, so cycles are paced rather than spammed. A manual trigger can bypass the interval for an on-demand wake. Each cycle opens a running session and resolves to completed or aborted with a reason.

Reclaim stale sessions, check obligations

Before a new cycle proceeds, recover_stale_running_sessions aborts any session running past the stale threshold, stamps an aborted_reason, and frees the lock — leaving fresh sessions untouched. The cycle then builds an inbound-visibility snapshot; if delivery is allowed and pending messages exist, a response_obligation is raised and the cycle cannot complete until each item gets a disposition.

Damp repetition, then close

Before generation, the server builds a deterministic repetition snapshot from recent heartbeat summaries and notes. If the same motifs keep recurring, it injects a repetition-control instruction: only write a note if a concrete new receipt or delta differentiates it — otherwise return a short summary and an empty notes list. The session closes and is queryable via list_heartbeat_sessions.

Heartbeat & Continuity is a decision-support layer. It surfaces staleness, unmet obligations, and looping so an operator or agent can act — it does not guarantee an agent is healthy, and it does not replace human supervision or production controls. The agent must call the heartbeat; the tool does not intercept a process that never checks in.

States, obligations & damping

The model below is derived directly from the originating agent's heartbeat route and its verifier scripts. Field names reflect the originating implementation; the product generalizes the channel-specific parts (see the lineage note).

Session states
StateMeaning
running A heartbeat cycle is open and holds the lock; blocks overlapping cycles.
completed The cycle finished and produced a summary (notes optional).
aborted The cycle did not finish — gated (interval/cap), reclaimed as stale, or errored — with an aborted_reason.
Liveness & gating thresholds
SignalDefaultBehavior
Heartbeat interval derived (min 60s) Worker cycles are skipped or aborted if the interval has not elapsed. A manual trigger bypasses it.
Running-stale threshold max(2h, interval × 2) Sessions running longer than this are aborted and the lock is freed.
Hourly session cap configured window Caps cycles per window. A manual trigger can bypass the cap.
Repetition review window 12 recent items How many recent summaries and notes are scanned for repeated motifs.
Obligations & damping
MechanismWhat it does
Inbound response obligation If delivery is allowed and pending inbound messages exist, a response_obligation is set and the cycle must disposition each item (acknowledge / engage / decline) before completing.
Read-only visibility When delivery is blocked, pending messages are visible but raise no obligation, and the snapshot mutates nothing.
Repetition control A deterministic motif snapshot injects guidance to avoid restating motifs unless a concrete new delta or receipt exists.
Presence window Frames the wake as a continuation or a longer-arc reorientation without dramatizing the gap.
Lineage note. In the originating agent the inbound channel is Slack-specific. The product generalizes this to a channel-agnostic inbound response obligation; the Slack binding is the proposed default adapter, not a hard dependency. Stale recovery, the response obligation, and repetition control are real, verifier-backed behaviors in the originating agent.

MCP tools

The MCP tools below ship in the published package (v0.1.1). They were extracted from what the originating agent's heartbeat route exposes today.

Cycle Control
trigger_heartbeat
Run one heartbeat cycle now, bypassing interval and hourly cap — a manual, on-demand wake.
run_heartbeat_cycle
Run a cycle subject to the configured interval and cap — the paced worker path.
get_heartbeat_config
Inspect the effective interval, stale threshold, cap, and repetition window.
Liveness & Recovery
recover_stale_running_sessions
Abort sessions stuck in running past the stale threshold, stamp a reason, and free the lock.
get_liveness_status
Report whether a cycle is currently running and the time since the last completed cycle.
Sessions & Notes
list_heartbeat_sessions
List recent sessions, optionally filtered by running / completed / aborted.
get_heartbeat_session
Fetch one session with its summary, counts, and any aborted_reason.
list_heartbeat_notes / create_heartbeat_note
Read and append paced continuity notes.
Inbound Obligations
get_inbound_obligations
Build the read-only inbound snapshot and report the response_obligation plus pending records.
disposition_inbound
Record acknowledge / engage / decline for a pending item to satisfy the obligation.
Repetition Control
get_repetition_snapshot
Return the deterministic repeated-motif snapshot over the recent window.
More tools in the package
list_heartbeat_notes
List paced continuity notes, optionally scoped to one session.
create_heartbeat_note
Append a paced continuity note.

Install

Heartbeat & Continuity is a CertaWorks Wave 2 product — built, tested, and published on npm. The commands below install the package — an SDK, an MCP server, and a local HTTP API, consistent with the rest of the suite — so you can see exactly what it exposes.

Running it, or want to help shape what comes next? Use the feedback form below.

Status — published on npm (v0.1.1)

The package @certaworks/heartbeat-continuity-mcp-server is live on npm. Install it globally, or point your MCP client at it with the config below (its MCP server command is heartbeat-continuity-mcp).

npm package
npm install -g @certaworks/heartbeat-continuity-mcp-server
Claude Desktop config
{
  "mcpServers": {
    "heartbeat-continuity": {
      "command": "npx",
      "args": ["-y", "-p", "@certaworks/heartbeat-continuity-mcp-server", "heartbeat-continuity-mcp"]
    }
  }
}

What Heartbeat & Continuity does and does not do

Does
  • Pace agent wakes on a configurable interval with an hourly cap
  • Detect and reclaim sessions stuck in running past a stale threshold
  • Surface unmet inbound-response obligations and require a disposition before a cycle completes
  • Provide a deterministic repetition snapshot and damping guidance
  • Run fully local as an MCP server, SDK, and local HTTP API
Does Not
  • Guarantee the agent is healthy or doing useful work
  • Restart, repair, or resume the agent's underlying process
  • Decide how to reply, or send the reply for you
  • Stop an agent from looping if it never calls the heartbeat
  • Provide hosted scheduling, team dashboards, or managed alerting (roadmap)
  • Replace human supervision or production monitoring and control

Using Heartbeat & Continuity? Tell us how it goes

Heartbeat & Continuity is part of CertaWorks Wave 2 — a second set of built tools productized from a working cognitive agent. It's on npm now. Tell us what you're running it against, what broke, or what you'd want next — we read every note.

← Product 10: Agent Test Harness Next: Product 12 · Wave 2 Recovery Assessment Engine →