From ac82bc16f840f26554bfb3a020e602388d43c842 Mon Sep 17 00:00:00 2001 From: Brennan Benson <79079362+brennanb2025@users.noreply.github.com> Date: Mon, 10 Aug 2026 04:48:04 -0700 Subject: [PATCH] fix: keep scoped RPC tests native-free --- src/main/ipc/runtime.ts | 3 ++- src/main/runtime/rpc/dispatcher.ts | 5 ++--- src/main/runtime/runtime-rpc.ts | 3 ++- src/main/ssh/ssh-remote-orca-cli.ts | 5 +++-- src/main/ssh/ssh-remote-orchestration-post-output.ts | 3 ++- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/main/ipc/runtime.ts b/src/main/ipc/runtime.ts index fbd3e7630d9..513e560343f 100644 --- a/src/main/ipc/runtime.ts +++ b/src/main/ipc/runtime.ts @@ -10,6 +10,7 @@ import type { import type { RuntimeRpcResponse } from '../../shared/runtime-rpc-envelope' import { TERMINAL_FIT_RESTORE_DEADLINE_MS } from '../../shared/terminal-fit-restore-deadline' import { RpcDispatcher } from '../runtime/rpc/dispatcher' +import { ALL_RPC_METHODS } from '../runtime/rpc/methods' function boundTerminalFitRestore(pending: Promise): Promise { let timer: ReturnType | undefined @@ -47,7 +48,7 @@ export function registerRuntimeHandlers(runtime: OrcaRuntimeService): void { _event, args: { method: string; params?: unknown } ): Promise> => { - return (await new RpcDispatcher({ runtime }).dispatch({ + return (await new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS }).dispatch({ id: 'desktop-ipc', authToken: 'desktop-ipc', method: args.method, diff --git a/src/main/runtime/rpc/dispatcher.ts b/src/main/runtime/rpc/dispatcher.ts index be11b2b0c64..ef832a1bd37 100644 --- a/src/main/runtime/rpc/dispatcher.ts +++ b/src/main/runtime/rpc/dispatcher.ts @@ -11,7 +11,6 @@ import { import type { FeatureInteractionId } from '../../../shared/feature-interactions' import { errorResponse, successResponse } from './errors' -import { ALL_RPC_METHODS } from './methods' import { emulatorProbe, emulatorProbeError } from '../../emulator/emulator-probe' import type { OrcaRuntimeService } from '../orca-runtime' import { @@ -26,7 +25,7 @@ import { OrchestrationLegacyCompatibility } from './orchestration-legacy-compati import type { RpcDispatchStreamingOptions } from './dispatcher-stream-options' import { invalidArgumentResponse, mapDispatcherError } from './dispatcher-error-response' -export type DispatcherOptions = { runtime: OrcaRuntimeService; methods?: readonly RpcAnyMethod[] } +export type DispatcherOptions = { runtime: OrcaRuntimeService; methods: readonly RpcAnyMethod[] } export class RpcDispatcher { private readonly runtime: OrcaRuntimeService @@ -34,7 +33,7 @@ export class RpcDispatcher { private readonly orchestrationMutations: OrchestrationMutationExecutor private readonly legacyOrchestration: OrchestrationLegacyCompatibility - constructor({ runtime, methods = ALL_RPC_METHODS }: DispatcherOptions) { + constructor({ runtime, methods }: DispatcherOptions) { this.runtime = runtime this.registry = buildRegistry(methods) this.orchestrationMutations = getOrchestrationMutationExecutor(runtime) diff --git a/src/main/runtime/runtime-rpc.ts b/src/main/runtime/runtime-rpc.ts index f44512d68cb..507552b1521 100644 --- a/src/main/runtime/runtime-rpc.ts +++ b/src/main/runtime/runtime-rpc.ts @@ -13,6 +13,7 @@ import { type RuntimeMetadataOwnershipWatch } from './runtime-metadata-ownership-watch' import { RpcDispatcher } from './rpc/dispatcher' +import { ALL_RPC_METHODS } from './rpc/methods' import type { RpcRequest, RpcResponse } from './rpc/core' import { errorResponse } from './rpc/errors' import type { RpcMessageContext, RpcTransport } from './rpc/transport' @@ -559,7 +560,7 @@ export class OrcaRuntimeRpcServer { metadataOwnershipPollMs = RUNTIME_METADATA_OWNERSHIP_POLL_MS }: OrcaRuntimeRpcServerOptions) { this.runtime = runtime - this.dispatcher = new RpcDispatcher({ runtime }) + this.dispatcher = new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS }) this.userDataPath = userDataPath this.pid = pid this.platform = platform diff --git a/src/main/ssh/ssh-remote-orca-cli.ts b/src/main/ssh/ssh-remote-orca-cli.ts index 3fc659133a7..602ca674271 100644 --- a/src/main/ssh/ssh-remote-orca-cli.ts +++ b/src/main/ssh/ssh-remote-orca-cli.ts @@ -3,8 +3,9 @@ import { randomUUID } from 'node:crypto' import type { RuntimeOrchestrationEnvelope } from '../../shared/runtime-rpc-envelope' import { readOrchestrationCompatibilityEvidence } from '../../shared/orchestration-compatibility-evidence' import { ORCHESTRATION_CONTRACT_VERSION } from '../../shared/protocol-version' -import { RpcDispatcher } from '../runtime/rpc/dispatcher' import type { RpcResponse } from '../runtime/rpc/core' +import { RpcDispatcher } from '../runtime/rpc/dispatcher' +import { ALL_RPC_METHODS } from '../runtime/rpc/methods' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import { HostCliUnavailableError, @@ -100,7 +101,7 @@ async function runLegacyRemoteOrcaCli( json: boolean, passthroughFailure: HostCliUnavailableError ): Promise { - const dispatcher = new RpcDispatcher({ runtime }) + const dispatcher = new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS }) const help = getRemoteLinearHelp(parsed) if (help) { return { stdout: `${help}\n`, stderr: '', exitCode: 0 } diff --git a/src/main/ssh/ssh-remote-orchestration-post-output.ts b/src/main/ssh/ssh-remote-orchestration-post-output.ts index 5d833651350..3778ea2524d 100644 --- a/src/main/ssh/ssh-remote-orchestration-post-output.ts +++ b/src/main/ssh/ssh-remote-orchestration-post-output.ts @@ -4,6 +4,7 @@ import { ORCHESTRATION_CONTRACT_VERSION } from '../../shared/protocol-version' import type { OrcaRuntimeService } from '../runtime/orca-runtime' import type { RpcResponse } from '../runtime/rpc/core' import { RpcDispatcher } from '../runtime/rpc/dispatcher' +import { ALL_RPC_METHODS } from '../runtime/rpc/methods' import type { RemoteOrcaCliPostOutput, RemoteOrcaCliRequest @@ -39,7 +40,7 @@ export async function acknowledgeRemoteOrcaCliPostOutput( answerMessageId: args.postOutput.answerMessageId }) } - const response = await new RpcDispatcher({ runtime }).dispatch({ + const response = await new RpcDispatcher({ runtime, methods: ALL_RPC_METHODS }).dispatch({ id: `remote-cli-post-output-${randomUUID()}`, authToken: 'remote-cli', method: 'orchestration.check',