Capability: heartbeat
A Temporal schedule wakes the harness every interval to poll the channels, snapshot the running tasks and sweep expired records.
What it is
The periodic pulse that makes waiting tasks progress without an inbound request and keeps the store within its retention policy. A schedule, not a process loop, so it survives the server process and is visible in Temporal. Lives in tiny_harness/service/heartbeat.py.
Current behaviour
- The worker SHALL ensure the agent's schedule exists, starting
HeartbeatWorkflowevery[heartbeat] interval(30 s by default) on the agent's task queue:tiny-harness-heartbeatfor the default agent id,tiny-harness-heartbeat-<id>for any other.tiny-harness schedules deleteremoves the configured agent's schedule. monitor_snapshotSHALL scan only the running task workflows on the agent's own task queue.- Each tick SHALL run
poll_channels(forwarding pending channel items to their tasks),monitor_snapshot(the task states and pending items) andretention_sweep(deleting expired store rows per kind). - WHEN a tick finds a task waiting on input whose reply has arrived THEN the task SHALL be resumed.
- The snapshot SHALL be exposed to the API layer at
GET /_monitorand to hooks through theheartbeat.tickoperation. - WHEN a tick fails THEN the failure SHALL be logged and the next tick run on schedule.
Design
History
| Work item | What changed | Links |
|---|---|---|
| issue-3 | The heartbeat workflow, schedule and activities (Layer 5) | spec, PR #11 |
| issue-36 | One schedule per agent; the scan filtered to the agent's queue | spec, PR #37, decision-009 |