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.
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.
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
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.
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.
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).
| State | Meaning |
|---|---|
| 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. |
| Signal | Default | Behavior |
|---|---|---|
| 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. |
| Mechanism | What 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. |
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.
running past the stale threshold, stamp a reason, and free the lock.running / completed / aborted.aborted_reason.response_obligation plus pending records.acknowledge / engage / decline for a pending item to satisfy the obligation.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.
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 install -g @certaworks/heartbeat-continuity-mcp-server
{
"mcpServers": {
"heartbeat-continuity": {
"command": "npx",
"args": ["-y", "-p", "@certaworks/heartbeat-continuity-mcp-server", "heartbeat-continuity-mcp"]
}
}
}
What Heartbeat & Continuity does and does not do
- Pace agent wakes on a configurable interval with an hourly cap
-
Detect and reclaim sessions stuck in
runningpast 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
- 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
Related Products
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.