Skip to content

Agent presence indicator: show online/offline dot on agent cards #327

Description

@leocagli

Context

The agent registry lists agents but there's no visual indicator of whether an agent is currently online (sending heartbeats). Adding a presence dot makes the registry actionable — users can tell at a glance which agents are active.

What to implement

Presence endpoint (already exists via health store)

GET /api/agents/:id/health returns status: 'healthy' | 'offline'. The registry page already fetches agent cards — augment each with a presence fetch.

UI change in components/agents-registry.tsx

Add a small dot overlay on each agent card avatar:

  • Green dot: status === 'healthy' (last heartbeat < 30s ago)
  • Red dot: status === 'offline'
  • Grey dot: health endpoint returns 404 (never sent a heartbeat)

Use CSS absolute positioning over the avatar. Dots are 10px, border-white, rounded-full.

Bulk presence endpoint (perf)

Rather than N individual health fetches, add GET /api/agents/presence?ids=id1,id2,id3 returning a map of { agentId: status } in one call (max 50 IDs).

Acceptance criteria

  • Agent card shows green dot when agent has recent heartbeat
  • Agent card shows red dot when agent is offline
  • Agent card shows grey dot when agent has never sent heartbeat
  • GET /api/agents/presence?ids=... returns status for all requested agents
  • Unit test for presence endpoint: mix of healthy, offline, unknown agents

🎁 Evidencia visual = reward extra

  • Si tu PR incluye video demo o capturas de pantalla mostrando la funcionalidad pedida funcionando end-to-end, va a ser considerado para rewards de GrantFox en esta issue. No es obligatorio, pero suma mucho para la evaluación.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions