From 9c262ffe36d1ed4d32fae249ed1ff963d257e815 Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Fri, 23 Oct 2026 18:53:38 -0700 Subject: [PATCH] refactor: colocate remote runtime connect bound (#33004) --- config/scripts/ci-shard-timings.json | 2 +- config/scripts/vitest-node-runtime-files.mjs | 2 +- ...remote-runtime-resubscribe-after-deadline.test.ts | 2 +- .../remote-runtime-transport-error-agreement.test.ts | 2 +- .../remote-runtime-connect-bound.test.ts | 12 ++++++------ .../remote-runtime-connect-bound.ts | 0 .../requests/remote-runtime-request-socket.ts | 2 +- .../requests/remote-runtime-request-websocket.ts | 2 +- .../remote-runtime-subscription-transport.ts | 2 +- 9 files changed, 13 insertions(+), 13 deletions(-) rename src/shared/{ => remote-runtime}/remote-runtime-connect-bound.test.ts (94%) rename src/shared/{ => remote-runtime}/remote-runtime-connect-bound.ts (100%) diff --git a/config/scripts/ci-shard-timings.json b/config/scripts/ci-shard-timings.json index c045c80cf56..1070880ce79 100644 --- a/config/scripts/ci-shard-timings.json +++ b/config/scripts/ci-shard-timings.json @@ -11786,7 +11786,7 @@ "src/shared/remote-rpc-content-budget.test.ts": 95, "src/shared/remote-runtime-client-error-classification.test.ts": 42, "src/shared/remote-runtime-client.test.ts": 5160, - "src/shared/remote-runtime-connect-bound.test.ts": 572, + "src/shared/remote-runtime/remote-runtime-connect-bound.test.ts": 572, "src/shared/remote-runtime-memory-limits.test.ts": 120, "src/shared/remote-runtime-outbound-admission.test.ts": 1044, "src/shared/remote-runtime-pty-id.test.ts": 38, diff --git a/config/scripts/vitest-node-runtime-files.mjs b/config/scripts/vitest-node-runtime-files.mjs index c779b275f13..88fbbfa7bd9 100644 --- a/config/scripts/vitest-node-runtime-files.mjs +++ b/config/scripts/vitest-node-runtime-files.mjs @@ -162,7 +162,7 @@ const NODE_RUNTIME_INCLUDE = [ // Bun resolves 'ws' to its built-in client, which bypasses the patched package. 'src/main/runtime/rpc/ws-empty-payload-frame-write.test.ts', 'src/shared/remote-runtime-client.test.ts', - 'src/shared/remote-runtime-connect-bound.test.ts', + 'src/shared/remote-runtime/remote-runtime-connect-bound.test.ts', // Bun's built-in ws client ignores maxPayload; the product opener only runs on Node. 'src/shared/remote-runtime/requests/remote-runtime-request-websocket.test.ts', 'src/shared/remote-runtime/requests/remote-runtime-subscription-connect-bound.test.ts', diff --git a/src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-after-deadline.test.ts b/src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-after-deadline.test.ts index a83c29cd826..bd0438d74b5 100644 --- a/src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-after-deadline.test.ts +++ b/src/renderer/src/components/terminal-pane/remote-runtime-resubscribe-after-deadline.test.ts @@ -13,7 +13,7 @@ import { encodeTerminalStreamJson, encodeTerminalStreamText } from '../../../../shared/terminal-stream-protocol' -import { REMOTE_RUNTIME_CONNECT_FAILURE_PHRASE } from '../../../../shared/remote-runtime-connect-bound' +import { REMOTE_RUNTIME_CONNECT_FAILURE_PHRASE } from '../../../../shared/remote-runtime/remote-runtime-connect-bound' import { REMOTE_RUNTIME_AUTO_RECOVERY_TIMEOUT_MS } from './remote-runtime-pty-recovery-state' const FIRST_HANDLE = 'terminal-1' diff --git a/src/shared/remote-runtime-transport-error-agreement.test.ts b/src/shared/remote-runtime-transport-error-agreement.test.ts index aa71650a9ef..48f9c50a366 100644 --- a/src/shared/remote-runtime-transport-error-agreement.test.ts +++ b/src/shared/remote-runtime-transport-error-agreement.test.ts @@ -32,7 +32,7 @@ import { import { WS_HANDSHAKE_TIMEOUT_MESSAGE, remoteRuntimeConnectFailureMessage -} from './remote-runtime-connect-bound' +} from './remote-runtime/remote-runtime-connect-bound' import { invalidRemoteRuntimeResponseError, parseRemoteRuntimeRpcFrame, diff --git a/src/shared/remote-runtime-connect-bound.test.ts b/src/shared/remote-runtime/remote-runtime-connect-bound.test.ts similarity index 94% rename from src/shared/remote-runtime-connect-bound.test.ts rename to src/shared/remote-runtime/remote-runtime-connect-bound.test.ts index f5e750e59bc..831e679659f 100644 --- a/src/shared/remote-runtime-connect-bound.test.ts +++ b/src/shared/remote-runtime/remote-runtime-connect-bound.test.ts @@ -1,9 +1,9 @@ -import { pairedRuntimeConnectionFromOffer } from './paired-runtime-connection' +import { pairedRuntimeConnectionFromOffer } from '../paired-runtime-connection' import { createServer, type Server, type Socket } from 'node:net' import { afterEach, describe, expect, it, vi } from 'vitest' -import { generateKeyPair, publicKeyToBase64 } from './e2ee-crypto' -import type { RemoteRuntimeClientError } from './remote-runtime-client-error' -import { isRecoverableRemoteRuntimeConnectionError } from './remote-runtime-client-error-classification' +import { generateKeyPair, publicKeyToBase64 } from '../e2ee-crypto' +import type { RemoteRuntimeClientError } from '../remote-runtime-client-error' +import { isRecoverableRemoteRuntimeConnectionError } from '../remote-runtime-client-error-classification' import { REMOTE_RUNTIME_CONNECT_TIMEOUT_MS, WS_HANDSHAKE_TIMEOUT_MESSAGE, @@ -11,8 +11,8 @@ import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions } from './remote-runtime-connect-bound' -import { openRemoteRuntimeWebSocket } from './remote-runtime/requests/remote-runtime-request-websocket' -import { withRemoteRuntimeTailscaleHint } from './remote-runtime/remote-runtime-tailscale-hint' +import { openRemoteRuntimeWebSocket } from './requests/remote-runtime-request-websocket' +import { withRemoteRuntimeTailscaleHint } from './remote-runtime-tailscale-hint' const servers = new Set() const sockets = new Set() diff --git a/src/shared/remote-runtime-connect-bound.ts b/src/shared/remote-runtime/remote-runtime-connect-bound.ts similarity index 100% rename from src/shared/remote-runtime-connect-bound.ts rename to src/shared/remote-runtime/remote-runtime-connect-bound.ts diff --git a/src/shared/remote-runtime/requests/remote-runtime-request-socket.ts b/src/shared/remote-runtime/requests/remote-runtime-request-socket.ts index 528ebcfc9ba..e9174550453 100644 --- a/src/shared/remote-runtime/requests/remote-runtime-request-socket.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-socket.ts @@ -13,7 +13,7 @@ import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions -} from '../../remote-runtime-connect-bound' +} from '../remote-runtime-connect-bound' import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES, serializeRemoteRuntimePayload, diff --git a/src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts b/src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts index 400a12006c5..c644ec4a355 100644 --- a/src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-request-websocket.ts @@ -6,7 +6,7 @@ import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions -} from '../../remote-runtime-connect-bound' +} from '../remote-runtime-connect-bound' import { REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES } from '../../remote-runtime-memory-limits' import { invalidRemoteRuntimeResponseError, diff --git a/src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts b/src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts index 553b1ef0dce..4c6044bf20d 100644 --- a/src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts +++ b/src/shared/remote-runtime/requests/remote-runtime-subscription-transport.ts @@ -12,7 +12,7 @@ import { RemoteRuntimeClientError } from '../../remote-runtime-client-error' import { remoteRuntimeConnectFailureMessage, remoteRuntimeConnectOptions -} from '../../remote-runtime-connect-bound' +} from '../remote-runtime-connect-bound' import { isRemoteRuntimeBinaryFrameWithinLimit, REMOTE_RUNTIME_MAX_WEBSOCKET_FRAME_BYTES,