Add agent presence heartbeat to workflow runner#449
Merged
khaliqgant merged 6 commits intomainfrom Feb 19, 2026
Merged
Conversation
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>
3ad49ff to
6b5993f
Compare
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registerExternalAgent()returns anAgentClientthat the runner uses for heartbeatsstartHeartbeat()sendsPOST /v1/agents/heartbeatevery 30s, stops when agent exitsProblem
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