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.
This commit is contained in:
Jinwoo Hong
2026-10-11 18:00:55 -04:00
committed by GitHub
parent 6dafde48e7
commit 3c84201608
2 changed files with 6 additions and 3 deletions
+4 -2
View File
@@ -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<RemoteRuntimeSubscription>()
const request = <T>(
method: string,
@@ -48,7 +50,7 @@ export function pairMobileClient(offer: RuntimeDesktopPairingOffer): PairedMobil
timeoutMs = DEFAULT_TIMEOUT_MS
): Promise<RuntimeRpcResponse<T>> =>
sendRemoteRuntimeRequest<T>(
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,
@@ -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<unknown>(
decodePairingOffer(pairingUrl),
pairedRuntimeConnectionFromOffer(decodePairingOffer(pairingUrl)),
'layout.subscribe',
{},
30_000,