Skip to content

feat: expose last heartbeat timestamp on /status endpoint #30

@nathanclevenger

Description

@nathanclevenger

Summary

The /status endpoint should include the lastHeartbeat timestamp so that consumers (monitoring tools, dashboards, other services) can verify the agent is alive and determine how recently it checked in — without needing a separate endpoint or internal access.


Problem

Currently, /status returns basic health info but omits heartbeat timing. This means:

  • External monitors can't detect a "running but stale" agent (process up, heartbeat stopped)
  • Dashboards have no single source of truth for liveness

Acceptance Criteria

  • GET /status response includes a lastHeartbeat field
  • lastHeartbeat is an ISO 8601 UTC timestamp (e.g. "2026-02-23T13:00:00.000Z")
  • If no heartbeat has ever fired, lastHeartbeat is null
  • The value updates correctly after each heartbeat cycle
  • No breaking changes to existing /status response fields
  • Unit test covers: first run (null), after one beat, after multiple beats

Response Shape (target)

{
  "status": "ok",
  "uptime": 3600,
  "lastHeartbeat": "2026-02-23T13:00:00.000Z"
}

Out of Scope

  • Heartbeat history / log
  • Alerting or thresholds
  • Changes to heartbeat frequency

Labels: enhancement, observability
Estimate: TBD — pending technical assessment from Cody

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions