Skip to content

Add agent presence heartbeat to workflow runner#449

Merged
khaliqgant merged 6 commits intomainfrom
feature/agent-presence-heartbeat
Feb 19, 2026
Merged

Add agent presence heartbeat to workflow runner#449
khaliqgant merged 6 commits intomainfrom
feature/agent-presence-heartbeat

Conversation

@khaliqgant
Copy link
Collaborator

@khaliqgant khaliqgant commented Feb 19, 2026

Summary

  • Workflow-spawned agents now send periodic REST heartbeats to Relaycast so they appear online in the dashboard while working
  • registerExternalAgent() returns an AgentClient that the runner uses for heartbeats
  • startHeartbeat() sends POST /v1/agents/heartbeat every 30s, stops when agent exits

Problem

Agents spawned by the workflow runner were registered in the Relaycast DB but never sent WebSocket pings. The PresenceDO marked them offline after 60 seconds, so the dashboard showed them as offline despite actively working.

Test plan

  • Run a workflow with multiple agents and verify they stay online in the Relaycast dashboard
  • Verify agents go offline after completing their task (heartbeat stops)
  • Verify no regressions in existing workflow execution

Depends on: AgentWorkforce/relaycast# (REST heartbeat endpoint)

devin-ai-integration[bot]

This comment was marked as resolved.

khaliqgant and others added 3 commits February 19, 2026 11:41
Spawned workflow agents now send periodic REST heartbeats to Relaycast
so they appear online in the dashboard while working. Previously agents
were registered in the DB but never sent heartbeats, causing the
PresenceDO to mark them offline after 60 seconds.

- registerExternalAgent() returns AgentClient for heartbeat use
- startHeartbeat() sends POST /v1/agents/heartbeat every 30s
- Heartbeat stops automatically when agent exits or times out

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use AgentClient.heartbeat() from @relaycast/sdk instead of raw fetch
- Add .unref() on heartbeat timer to prevent blocking process exit
  (consistent with existing pattern in barrier.ts, consensus.ts, etc.)

Note: requires @relaycast/sdk publish from relaycast#34 first.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The runner instructed agents to call `relay_release` but the actual
tool name in @relaycast/mcp is `remove_agent`. Codex agents had the
tool available via .codex/config.toml but could never find it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@khaliqgant khaliqgant force-pushed the feature/agent-presence-heartbeat branch from 3ad49ff to 6b5993f Compare February 19, 2026 10:41
devin-ai-integration[bot]

This comment was marked as resolved.

khaliqgant and others added 3 commits February 19, 2026 11:50
SDK 0.3.1 includes the AgentClient.heartbeat() method, fixing
the CI build. Also corrects misleading JSDoc on registerExternalAgent
(returns null on conflict, not existing token).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Instead of a one-line "completed" or "failed" message, the workflow
runner now posts a detailed report to the relaycast channel including:
- Per-step status with agent name, verification, and retry counts
- Overall summary with elapsed time and confidence score
- On failure: which steps failed and the error messages

Improves observability for anyone watching the workflow channel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Ensures CI resolves the version with AgentClient.heartbeat().

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@khaliqgant khaliqgant merged commit 76dbab6 into main Feb 19, 2026
38 of 39 checks passed
@khaliqgant khaliqgant deleted the feature/agent-presence-heartbeat branch February 19, 2026 11:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant