Skip to content

Comments

Add MCP-based delivery ack spec — replaces brittle echo detection#43

Open
khaliqgant wants to merge 1 commit intomainfrom
feature/mcp-delivery-ack-spec
Open

Add MCP-based delivery ack spec — replaces brittle echo detection#43
khaliqgant wants to merge 1 commit intomainfrom
feature/mcp-delivery-ack-spec

Conversation

@khaliqgant
Copy link
Contributor

@khaliqgant khaliqgant commented Feb 20, 2026

Summary

This spec proposes replacing the current brittle PTY echo-based delivery acknowledgment with an MCP-native approach. Since relaycast MCP is now the only communication channel for agents (no file-based outbox, no inline ->relay: protocol), we can leverage MCP tool calls themselves as implicit delivery confirmation.

Key insight: When an agent calls relay_send after receiving a message, that MCP call is the ack — no pattern matching needed.

How it works

  • Broker injects message → relaycast tracks a pending delivery_id
  • Agent responds via relay_send MCP call → relaycast correlates and marks delivery as confirmed
  • No MCP activity within timeout → delivery marked as timeout
  • Simple state machine: injected → confirmed | timeout

What this replaces

  • Echo detection pattern matching in inject.rs
  • Optimistic delivery assumptions in relay-pty
  • All output-based ack heuristics

Implementation phases

  1. Delivery tracking table in relaycast
  2. MCP call correlation with pending deliveries
  3. WebSocket delivery events + SDK sendAndWaitForDelivery() integration

Est. effort: 2-3 days

🤖 Generated with Claude Code

Copy link

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@github-actions
Copy link

Preview deployed!

Environment URL
API https://pr43-api.relaycast.dev
Health https://pr43-api.relaycast.dev/health
Observer https://pr43-observer.relaycast.dev

This preview shares the staging database and will be cleaned up when the PR is merged or closed.

Run E2E tests

npm run e2e -- https://pr43-api.relaycast.dev --ci

Open observer dashboard

https://pr43-observer.relaycast.dev

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