Ben Barclay
64a507da44
feat(relay): handle passthrough_forward over the WS (Phase 5 §5.1, gateway half) ( #50702 )
...
The connector half (gateway-gateway) moves the passthrough plane's post-ACK
forward off the HTTP gatewayEndpoint onto the gateway's outbound /relay WS via
a new passthrough_forward frame. This is the gateway side: the relay adapter
now RECEIVES and handles that frame, so a hosted gateway (no public IP) can
process forwarded Class-2/3 traffic (Discord interactions, Twilio) over the
socket it already holds — closing the "passthrough inbound doesn't work for
hosted gateways" gap.
- ws_transport.py: decode the passthrough_forward frame; PassthroughForward
dataclass + _passthrough_from_wire (base64 body -> exact bytes, byte parity
with the connector's toPassthroughForward); set_passthrough_handler mirrors
set_interrupt_inbound_handler.
- transport.py: PassthroughHandler type + set_passthrough_handler on the
RelayTransport protocol.
- adapter.py: connect() wires the passthrough handler; _on_passthrough decodes
the (already-sanitized, token-free) forward and, for a Discord interaction,
converts it to a MessageEvent routed through the normal agent path
(handle_message) — the reply egresses over the outbound / token-less
follow_up path, so the gateway never holds the interaction credential. Never
raises (a bad forward can't kill the read loop). Non-discord forwards (Twilio)
are logged + dropped for now.
- docs/relay-connector-contract.md: document the passthrough_forward frame +
PassthroughForward shape + §3.1.
The interaction -> MessageEvent CONVERSION semantics (slash-command vs button
UX, option rendering) are the open sub-design flagged in the spec; the TRANSPORT
+ receive mechanism (this) is settled per Ben's Gate-2 decision: "the relay
adapter handles receiving these events over the WS."
Tests (tests/gateway/relay/test_relay_passthrough.py): byte-preservation
round-trip (+ malformed-body tolerance), connect() wiring, application-command
and message-component interactions route through handle_message with correct
session source + scope capture, malformed/non-discord forwards dropped cleanly.
100 relay tests green. Pairs with the connector PR (gateway-gateway).
2026-06-22 20:10:57 +10:00
..
2026-05-20 13:00:57 -07:00
2026-06-22 20:10:57 +10:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-10 14:01:34 +10:00
2026-05-28 22:26:25 -07:00
2026-06-21 11:57:15 -07:00
2026-06-13 06:38:29 -07:00
2026-06-08 11:29:53 -07:00
2026-06-06 09:00:10 -07:00
2026-06-16 03:35:24 +05:30
2026-06-20 10:26:45 -07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 10:04:57 -07:00
2026-06-14 03:25:49 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 07:26:03 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:15:14 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 16:59:58 -07:00
2026-06-07 18:05:58 -07:00
2026-06-02 16:55:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 01:31:45 -07:00
2026-06-01 18:52:05 -07:00
2026-05-18 21:38:05 -07:00
2026-06-21 11:35:09 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:13 -07:00
2026-06-15 05:51:47 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-18 10:19:40 -07:00
2026-06-08 06:32:23 -07:00
2026-06-13 04:51:59 -07:00
2026-06-07 22:39:51 -07:00
2026-06-14 03:20:21 -07:00
2026-06-20 10:26:45 -07:00
2026-05-24 01:31:45 -07:00
2026-06-21 22:43:57 -07:00
2026-06-18 14:46:33 +10:00
2026-05-29 19:06:05 -07:00
2026-05-25 14:54:02 -07:00
2026-05-09 11:04:46 -07:00
2026-06-20 10:26:45 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 06:31:08 -07:00
2026-06-07 06:21:37 -07:00
2026-06-11 15:39:01 -04:00
2026-06-21 22:43:45 -07:00
2026-06-19 12:03:08 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-22 14:21:41 -07:00
2026-06-10 00:24:06 -07:00
2026-05-27 03:35:33 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-05-22 14:21:41 -07:00
2026-05-22 14:21:41 -07:00
2026-06-14 17:02:21 +07:00
2026-05-17 02:29:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-05 03:10:40 -07:00
2026-06-16 05:49:24 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 22:43:45 -07:00
2026-06-11 11:58:19 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 13:33:52 -07:00
2026-05-30 07:28:06 -07:00
2026-05-30 18:58:46 -07:00
2026-05-30 07:38:03 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 15:49:59 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-27 02:41:24 -07:00
2026-06-19 06:31:56 -07:00
2026-05-28 22:26:25 -07:00
2026-06-10 14:01:34 +10:00
2026-06-14 03:25:08 -07:00
2026-05-11 07:06:27 -07:00
2026-06-04 16:54:40 -07:00
2026-06-06 11:46:24 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 11:11:23 -07:00
2026-06-20 10:57:41 -07:00
2026-05-24 01:31:45 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 12:43:44 -07:00
2026-06-01 20:30:24 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 07:35:33 -07:00
2026-06-12 12:02:41 -07:00
2026-06-04 21:55:20 -07:00
2026-05-28 22:26:25 -07:00
2026-05-24 15:03:27 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 21:22:11 -07:00
2026-06-20 10:26:45 -07:00
2026-06-16 06:34:54 -07:00
2026-06-08 15:12:12 -07:00
2026-06-05 09:10:26 -07:00
2026-05-26 14:28:51 -07:00
2026-06-21 11:56:46 -07:00
2026-06-20 23:20:16 -07:00
2026-06-20 10:26:45 -07:00
2026-05-16 12:55:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 15:49:59 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 13:33:23 -07:00
2026-06-19 07:07:06 -07:00
2026-06-19 19:58:26 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-19 07:34:15 -07:00
2026-06-12 08:51:10 +00:00
2026-05-29 13:17:46 -07:00
2026-05-28 22:26:25 -07:00
2026-06-02 05:52:54 -07:00
2026-05-29 17:36:58 +00:00
2026-06-21 11:56:46 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-02 17:27:44 -07:00
2026-06-04 05:56:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-06 18:44:44 -07:00
2026-06-03 20:25:17 +08:00
2026-06-19 07:52:37 -07:00
2026-06-21 20:21:11 -07:00
2026-06-17 16:37:45 -07:00
2026-05-22 14:21:41 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 15:16:53 +05:30
2026-06-14 03:25:08 -07:00
2026-06-10 23:22:43 -07:00
2026-06-08 01:25:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-19 16:59:58 -07:00
2026-06-15 07:46:34 -07:00
2026-05-20 13:00:57 -07:00
2026-05-27 05:21:53 -07:00
2026-05-28 22:26:25 -07:00
2026-06-12 12:02:41 -07:00
2026-05-30 07:38:03 -07:00
2026-05-15 14:32:14 -07:00
2026-06-07 23:57:32 -07:00
2026-06-03 23:51:44 -06:00
2026-06-19 06:31:13 -07:00
2026-06-21 12:34:22 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-18 22:25:15 -07:00
2026-06-16 15:49:59 -07:00
2026-06-03 06:36:46 -07:00
2026-05-09 14:18:20 +03:00
2026-05-28 22:26:25 -07:00
2026-06-19 18:06:38 -04:00
2026-06-21 08:26:19 -07:00
2026-05-28 22:26:25 -07:00
2026-05-23 02:25:53 -07:00
2026-06-07 22:10:32 -07:00
2026-05-27 02:41:24 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-04 07:50:45 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 15:23:36 -07:00
2026-06-20 10:26:45 -07:00
2026-06-08 15:12:12 -07:00
2026-05-10 09:01:51 -07:00
2026-06-20 13:47:14 +05:30
2026-05-28 22:26:25 -07:00
2026-06-20 21:00:46 +05:30
2026-06-12 01:07:50 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-06-07 02:15:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 16:41:17 -07:00
2026-06-15 07:46:34 -07:00
2026-06-21 17:23:33 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-31 09:29:03 -07:00
2026-06-13 13:44:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 13:55:50 -07:00
2026-06-02 00:33:50 -07:00
2026-06-09 23:16:23 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 20:05:37 -07:00
2026-06-19 16:20:59 -07:00
2026-06-20 10:26:45 -07:00
2026-06-11 11:58:19 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 22:43:45 -07:00
2026-06-21 12:36:26 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 22:43:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-27 02:41:24 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 12:03:24 -07:00
2026-06-21 08:26:28 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-05-28 23:25:52 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 01:54:16 +05:30
2026-06-01 17:31:32 -07:00
2026-05-28 22:26:25 -07:00
2026-06-16 06:34:54 -07:00
2026-06-21 22:43:57 -07:00
2026-06-01 02:04:14 -07:00
2026-06-12 13:42:42 -04:00
2026-06-04 06:56:28 -07:00
2026-06-08 01:25:35 -07:00
2026-05-28 22:26:25 -07:00
2026-06-05 18:05:05 -07:00
2026-06-13 03:33:27 -07:00
2026-06-10 02:57:39 -07:00
2026-05-28 22:26:25 -07:00
2026-06-21 19:05:27 -07:00
2026-06-14 02:40:54 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-05-28 22:26:25 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-07 21:50:57 -07:00
2026-06-07 22:10:17 -07:00
2026-06-20 17:05:27 -07:00
2026-06-21 17:23:33 -07:00
2026-06-11 07:51:01 -07:00
2026-06-21 17:23:33 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-20 10:26:45 -07:00
2026-06-21 13:32:22 -07:00
2026-06-20 10:26:45 -07:00