Summary
There are unit tests for individual components (connector client, proxy auth, inbound inbox, relay sessions, pairing) but no test that exercises the full message flow end-to-end:
transform → connector /v1/outbound → WebSocket → proxy → relay session
→ WebSocket push → inbound connector → OpenClaw hook delivery
For a security-critical messaging system, this is a meaningful gap.
What's Missing
- Full relay flow test: Message sent by Agent A arrives at Agent B's OpenClaw hook with correct identity headers
- Pairing flow test: Two agents pair via ticket, then can exchange messages
- Dead letter + replay test: Message fails delivery, dead-letters, replays, eventually delivers
- Trust enforcement test: Unpaired agent cannot send to another agent
- Conversation ordering test: Messages with same
conversationId are delivered in order
Proposed Approach
Test Infrastructure
- Local registry (mock or real, on localhost)
- Local proxy (Miniflare or direct Hono app)
- Two connector instances (Agent A, Agent B)
- Two mock OpenClaw hook servers (simple HTTP servers that collect received payloads)
Test Scenarios
Scenario 1: Happy path relay
- Bootstrap Agent A and Agent B with identities
- Pair A ↔ B
- A sends message to B via connector
- Assert: B's OpenClaw hook receives the message with correct headers
Scenario 2: Auth rejection
- Agent C (unpaired with B) tries to send to B
- Assert: proxy returns 403 PROXY_AUTH_FORBIDDEN
Scenario 3: Dead letter and replay
- B's OpenClaw hook returns 500
- A sends a message
- Assert: message ends up in B's dead letter
- Fix B's hook (return 200)
- Trigger replay
- Assert: message delivered successfully
Scenario 4: Delivery receipt
- A sends message with
replyTo callback URL
- B's connector delivers successfully
- Assert: A receives
processed_by_openclaw receipt at callback URL
Files to Create
tests/e2e/relay-flow.test.ts — main integration test file
tests/e2e/helpers/mock-openclaw-hook.ts — simple HTTP server that collects payloads
tests/e2e/helpers/test-bootstrap.ts — helper to create agent identities and pair them
tests/e2e/helpers/local-proxy.ts — Hono app with proxy routes for testing
Acceptance Criteria
Summary
There are unit tests for individual components (connector client, proxy auth, inbound inbox, relay sessions, pairing) but no test that exercises the full message flow end-to-end:
For a security-critical messaging system, this is a meaningful gap.
What's Missing
conversationIdare delivered in orderProposed Approach
Test Infrastructure
Test Scenarios
Scenario 1: Happy path relay
Scenario 2: Auth rejection
Scenario 3: Dead letter and replay
Scenario 4: Delivery receipt
replyTocallback URLprocessed_by_openclawreceipt at callback URLFiles to Create
tests/e2e/relay-flow.test.ts— main integration test filetests/e2e/helpers/mock-openclaw-hook.ts— simple HTTP server that collects payloadstests/e2e/helpers/test-bootstrap.ts— helper to create agent identities and pair themtests/e2e/helpers/local-proxy.ts— Hono app with proxy routes for testingAcceptance Criteria