From 3c8420160862e8486e9004d95aff5414d65e4544 Mon Sep 17 00:00:00 2001 From: Jinwoo Hong <73622457+Jinwoo-H@users.noreply.github.com> Date: Sun, 11 Oct 2026 18:00:55 -0400 Subject: [PATCH] test(e2e): open the oracle's headless layout stream with a paired connection (#27601) * test(e2e): open the oracle's headless layout stream with a paired connection The remote subscription now takes a paired connection rather than a pairing offer; build one from the offer the way the CLI does. * test(e2e): build the paired mobile client's connection from its offer Same stale call as the oracle stream after the subscription and request functions took a paired connection. --- tests/e2e/helpers/paired-mobile-client.ts | 6 ++++-- tests/e2e/helpers/workspace-layout-oracle-stream.ts | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/tests/e2e/helpers/paired-mobile-client.ts b/tests/e2e/helpers/paired-mobile-client.ts index bbed0c524c9..a8c89a06bfb 100644 --- a/tests/e2e/helpers/paired-mobile-client.ts +++ b/tests/e2e/helpers/paired-mobile-client.ts @@ -1,4 +1,5 @@ import { MOBILE_RUNTIME_CLIENT_CAPABILITIES } from '../../../mobile/src/transport/mobile-runtime-client-capabilities' +import { pairedRuntimeConnectionFromOffer } from '../../../src/shared/paired-runtime-connection' import { decodePairingOffer } from '../../../src/shared/pairing' import { sendRemoteRuntimeRequest, @@ -41,6 +42,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil if (pairing.scope !== 'mobile') { throw new Error(`Expected a mobile-scoped pairing offer, got scope ${String(pairing.scope)}`) } + const connection = pairedRuntimeConnectionFromOffer(pairing) const open = new Set() const request = ( method: string, @@ -48,7 +50,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil timeoutMs = DEFAULT_TIMEOUT_MS ): Promise> => sendRemoteRuntimeRequest( - pairing, + connection, method, params, timeoutMs, @@ -67,7 +69,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil }, subscribe: async (method, params, callbacks, timeoutMs = DEFAULT_TIMEOUT_MS) => { const subscription = await subscribeRemoteRuntimeRequest( - pairing, + connection, method, params, timeoutMs, diff --git a/tests/e2e/helpers/workspace-layout-oracle-stream.ts b/tests/e2e/helpers/workspace-layout-oracle-stream.ts index 8668c24b05a..7008c344884 100644 --- a/tests/e2e/helpers/workspace-layout-oracle-stream.ts +++ b/tests/e2e/helpers/workspace-layout-oracle-stream.ts @@ -4,6 +4,7 @@ */ import type { Page } from '@stablyai/playwright-test' +import { pairedRuntimeConnectionFromOffer } from '../../../src/shared/paired-runtime-connection' import { decodePairingOffer } from '../../../src/shared/pairing' import { subscribeRemoteRuntimeRequest } from '../../../src/shared/remote-runtime-client' import type { RuntimeRpcResponse } from '../../../src/shared/runtime-rpc-envelope' @@ -51,7 +52,7 @@ export async function subscribeHeadlessLayout( ): Promise<{ close: () => void }> { feed.reopening() const subscription = await subscribeRemoteRuntimeRequest( - decodePairingOffer(pairingUrl), + pairedRuntimeConnectionFromOffer(decodePairingOffer(pairingUrl)), 'layout.subscribe', {}, 30_000,