You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/08/20 10:36:48 UTC
(maka) branch main updated: refactor(runtime-host): retire client surface identity plumbing (#3277)
This is an automated email from the ASF dual-hosted git repository.
Astro-Han pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maka.git
The following commit(s) were added to refs/heads/main by this push:
new a6f33c952 refactor(runtime-host): retire client surface identity plumbing (#3277)
a6f33c952 is described below
commit a6f33c9522ee2d4366046b84e5ed442aa1aaafe2
Author: ooopSok <81...@users.noreply.github.com>
AuthorDate: Thu Aug 20 18:36:44 2026 +0800
refactor(runtime-host): retire client surface identity plumbing (#3277)
* refactor(runtime-host): retire client surface handshake plumbing
Generated-by: Codex
* test(runtime-host): harden surface compatibility guards
Generated-by: Codex
---
.../runtime-host-client-pricing-uds.test.ts | 2 -
.../main/__tests__/runtime-host-client-uds.test.ts | 3 -
.../src/main/runtime-host-desktop-candidate.ts | 2 -
.../src/__tests__/runtime-host-cli-context.test.ts | 88 ++++++++++++++---
.../src/__tests__/runtime-host-run-command.test.ts | 1 -
packages/cli/src/activation-command.ts | 5 -
packages/cli/src/run-command-core.ts | 2 -
packages/cli/src/runtime-host-access-command.ts | 1 -
.../runtime-host-capability-provider-command.ts | 1 -
packages/cli/src/runtime-host-cli-context.ts | 7 +-
packages/cli/src/runtime-host-project-command.ts | 1 -
packages/cli/src/runtime-host-run-command.ts | 1 -
packages/cli/src/runtime-host-service-manager.ts | 1 -
packages/cli/src/runtime-host-setup-command.ts | 1 -
packages/cli/src/runtime-host-tui-command.ts | 2 +-
packages/cli/src/runtime-host-tui-context.ts | 2 +-
.../src/__tests__/agent-graph-coordinator.test.ts | 1 -
.../__tests__/agent-graph-two-client-uds.test.ts | 8 +-
.../src/__tests__/artifact-coordinator.test.ts | 1 -
.../src/__tests__/artifact-two-client-uds.test.ts | 12 +--
.../src/__tests__/authenticated-websocket.test.ts | 16 +---
.../__tests__/canonical-session-projection.test.ts | 1 -
.../client-capability-coordinator.test.ts | 12 +--
.../src/__tests__/client-capability-uds.test.ts | 2 -
.../connection-effect-coordinator.test.ts | 1 -
.../src/__tests__/connection-resource.test.ts | 1 -
.../src/__tests__/connection-session.test.ts | 3 -
.../src/__tests__/daily-review-coordinator.test.ts | 1 -
.../__tests__/daily-review-two-client-uds.test.ts | 10 +-
.../__tests__/deep-research-two-client-uds.test.ts | 11 +--
.../src/__tests__/execution-composition.test.ts | 8 --
.../__tests__/execution-host-continuation.test.ts | 18 ++--
.../src/__tests__/execution-host-message.test.ts | 18 ++--
.../src/__tests__/execution-host-queue.test.ts | 26 ++---
.../src/__tests__/execution-host-recovery.test.ts | 16 ++--
.../src/__tests__/execution-host.test.ts | 46 ++++-----
.../execution-inspect-coordinator.test.ts | 1 -
.../src/__tests__/execution-inspect-uds.test.ts | 1 -
.../__tests__/execution-model-composition.test.ts | 7 --
.../__tests__/external-session-coordinator.test.ts | 1 -
.../src/__tests__/fixtures/connect-client.ts | 12 +--
.../__tests__/fixtures/electron-connect-parent.ts | 1 -
.../src/__tests__/fixtures/execution-host-suite.ts | 7 +-
.../src/__tests__/framed-transport.test.ts | 1 -
.../src/__tests__/goal-coordinator.test.ts | 1 -
.../src/__tests__/goal-root-authority.test.ts | 1 -
.../src/__tests__/handshake-compatibility.test.ts | 28 +++++-
.../runtime-host/src/__tests__/host-kernel.test.ts | 105 ++++++++++-----------
.../src/__tests__/host-profile.test.ts | 7 --
.../__tests__/hosted-execution-coordinator.test.ts | 1 -
.../src/__tests__/hosted-execution-runner.test.ts | 1 -
.../src/__tests__/interaction-coordinator.test.ts | 1 -
.../src/__tests__/memory-coordinator.test.ts | 1 -
.../src/__tests__/memory-two-client-uds.test.ts | 14 +--
.../src/__tests__/message-coordinator.test.ts | 1 -
.../src/__tests__/oauth-coordinator.test.ts | 1 -
.../src/__tests__/oauth-two-client-uds.test.ts | 12 +--
.../src/__tests__/operation-dispatcher.test.ts | 1 -
.../src/__tests__/owned-candidate.test.ts | 2 -
.../src/__tests__/plan-two-client-uds.test.ts | 11 +--
.../__tests__/project-catalog-coordinator.test.ts | 1 -
.../project-catalog-two-client-uds.test.ts | 13 +--
.../runtime-host/src/__tests__/protocol.test.ts | 28 ++++++
.../src/__tests__/root-turn-coordinator.test.ts | 1 -
.../__tests__/runtime-policy-coordinator.test.ts | 1 -
.../__tests__/runtime-resource-coordinator.test.ts | 1 -
.../src/__tests__/runtime-resource-process.test.ts | 1 -
.../runtime-resource-two-client-uds.test.ts | 9 +-
.../__tests__/session-catalog-coordinator.test.ts | 1 -
.../session-catalog-two-client-uds.test.ts | 15 +--
.../session-continuity-coordinator.test.ts | 1 -
.../__tests__/session-effect-coordinator.test.ts | 1 -
.../session-effect-two-client-uds.test.ts | 11 +--
.../session-retirement-coordinator.test.ts | 1 -
.../session-revision-two-client-uds.test.ts | 14 +--
.../__tests__/session-subscription-client.test.ts | 1 -
.../__tests__/skill-catalog-coordinator.test.ts | 1 -
.../__tests__/skill-catalog-two-client-uds.test.ts | 17 +---
.../usage-pricing-client-correlation.test.ts | 1 -
.../src/__tests__/usage-pricing-protocol.test.ts | 1 -
.../__tests__/usage-pricing-root-identity.test.ts | 1 -
.../__tests__/usage-pricing-two-client-uds.test.ts | 17 +---
.../runtime-host/src/client/connect-or-spawn.ts | 3 -
packages/runtime-host/src/client/connection.ts | 25 +++--
packages/runtime-host/src/client/host-profile.ts | 3 -
.../runtime-host/src/client/hosted-execution.ts | 2 -
packages/runtime-host/src/protocol/index.ts | 25 -----
.../src/server/execution-composition.ts | 1 -
packages/runtime-host/src/server/host-kernel.ts | 1 -
.../src/server/operation-dispatcher.ts | 2 -
90 files changed, 325 insertions(+), 426 deletions(-)
diff --git a/apps/desktop/src/main/__tests__/runtime-host-client-pricing-uds.test.ts b/apps/desktop/src/main/__tests__/runtime-host-client-pricing-uds.test.ts
index d2c930d62..b190e874f 100644
--- a/apps/desktop/src/main/__tests__/runtime-host-client-pricing-uds.test.ts
+++ b/apps/desktop/src/main/__tests__/runtime-host-client-pricing-uds.test.ts
@@ -96,7 +96,6 @@ test('drives the Desktop Pricing adapter through a real Runtime Host connection'
});
const connected = await connectRuntimeHost({
rootPath: base,
- surface: 'desktop',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -114,7 +113,6 @@ test('drives the Desktop Pricing adapter through a real Runtime Host connection'
await client.close();
const reconnected = await connectRuntimeHost({
rootPath: base,
- surface: 'desktop',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/apps/desktop/src/main/__tests__/runtime-host-client-uds.test.ts b/apps/desktop/src/main/__tests__/runtime-host-client-uds.test.ts
index 4869c9367..b4233e4e1 100644
--- a/apps/desktop/src/main/__tests__/runtime-host-client-uds.test.ts
+++ b/apps/desktop/src/main/__tests__/runtime-host-client-uds.test.ts
@@ -67,7 +67,6 @@ test('drives Desktop Session operations through a real Runtime Host connection',
});
const connected = await connectRuntimeHost({
rootPath: base,
- surface: 'desktop',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -351,7 +350,6 @@ test('drives the renderer Session execution facade through real UDS framing', as
});
const connected = await connectRuntimeHost({
rootPath: base,
- surface: 'desktop',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -476,7 +474,6 @@ test('drives bounded Session domain projections through real UDS framing', async
});
const connected = await connectRuntimeHost({
rootPath: base,
- surface: 'desktop',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/apps/desktop/src/main/runtime-host-desktop-candidate.ts b/apps/desktop/src/main/runtime-host-desktop-candidate.ts
index f301bef2f..b6b3069fe 100644
--- a/apps/desktop/src/main/runtime-host-desktop-candidate.ts
+++ b/apps/desktop/src/main/runtime-host-desktop-candidate.ts
@@ -287,7 +287,6 @@ async function startRemoteDesktopRuntimeHostCandidate(
const connection = await connectRemoteRuntimeHostProfile({
profile: remote.profile,
credential: remote.credential,
- surface: "desktop",
clientInstanceId: input.clientInstanceId ?? randomUUID(),
...(input.signal === undefined ? {} : { signal: input.signal }),
...(input.connectTimeoutMs === undefined
@@ -671,7 +670,6 @@ function connectInput(
): ConnectOrSpawnRuntimeHostInput {
return {
rootPath: input.rootPath,
- surface: "desktop",
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/cli/src/__tests__/runtime-host-cli-context.test.ts b/packages/cli/src/__tests__/runtime-host-cli-context.test.ts
index 46e45d86d..30fc6ea0c 100644
--- a/packages/cli/src/__tests__/runtime-host-cli-context.test.ts
+++ b/packages/cli/src/__tests__/runtime-host-cli-context.test.ts
@@ -18,7 +18,6 @@ import {
RUNTIME_HOST_COMPATIBILITY_EPOCH,
RUNTIME_HOST_PROTOCOL_VERSION,
RUNTIME_HOST_REGISTRATION_SCHEMA_VERSION,
- type ClientSurface,
type HostIncompatible,
} from '@maka/runtime-host/protocol';
import {
@@ -50,7 +49,6 @@ test('CLI Runtime Host bootstrap launches the execution composition', async () =
const context = await connectRuntimeHostCli(
{
rootPath: '/runtime-host-root',
- surface: 'activation',
},
{
connectOrSpawn: async (input) => {
@@ -80,7 +78,7 @@ test('CLI Runtime Host bootstrap launches the execution composition', async () =
test('non-interactive CLI reports how to retire an incompatible Runtime Host', async () => {
await assert.rejects(
connectRuntimeHostCli(
- { rootPath: '/runtime-host-root', surface: 'run' },
+ { rootPath: '/runtime-host-root' },
{
connectOrSpawn: async () => ({
kind: 'incompatible',
@@ -123,7 +121,7 @@ test('non-interactive CLI reports how to retire an incompatible Runtime Host', a
test('CLI explains a service Host without inventing resident work', async () => {
await assert.rejects(
connectRuntimeHostCli(
- { rootPath: '/runtime-host-root', surface: 'run' },
+ { rootPath: '/runtime-host-root' },
{
connectOrSpawn: async () => ({
kind: 'incompatible',
@@ -166,7 +164,7 @@ test('Runtime Host conflict waits only after an explicit wait answer', () => {
test('CLI reports an actionable stored-data startup failure', async () => {
await assert.rejects(
connectRuntimeHostCli(
- { rootPath: '/runtime-host-root', surface: 'run' },
+ { rootPath: '/runtime-host-root' },
{
connectOrSpawn: async () => ({
kind: 'failed',
@@ -200,7 +198,7 @@ test('remote CLI profiles pin root identity and resolve credential outside the p
close: async () => {},
} as unknown as RuntimeHostConnection;
const context = await connectRuntimeHostCli(
- { rootPath: '/unused-local-root', surface: 'run', profileId: 'office' },
+ { rootPath: '/unused-local-root', profileId: 'office' },
{
connectOrSpawn: async () => {
throw new Error('remote profile must not use local discovery');
@@ -292,7 +290,6 @@ test('remote CLI profile state and Client identity use the explicit Client Data
{
rootPath: '/unused-local-root',
clientDataRoot,
- surface: 'run',
profileId: 'office',
},
{
@@ -316,26 +313,87 @@ test('remote CLI profile state and Client identity use the explicit Client Data
await context.close();
});
-test('CLI and TUI remote profiles preserve shared compatibility errors', async () => {
+test('remote CLI enables SSH prompts only for an explicitly interactive TTY', async (t) => {
+ const stdinIsTTY = Object.getOwnPropertyDescriptor(process.stdin, 'isTTY');
+ const stdoutIsTTY = Object.getOwnPropertyDescriptor(process.stdout, 'isTTY');
+ t.after(() => {
+ if (stdinIsTTY) Object.defineProperty(process.stdin, 'isTTY', stdinIsTTY);
+ else Reflect.deleteProperty(process.stdin, 'isTTY');
+ if (stdoutIsTTY) Object.defineProperty(process.stdout, 'isTTY', stdoutIsTTY);
+ else Reflect.deleteProperty(process.stdout, 'isTTY');
+ });
+ Object.defineProperty(process.stdin, 'isTTY', { configurable: true, value: true });
+ Object.defineProperty(process.stdout, 'isTTY', { configurable: true, value: true });
+
+ const rootId = 'd'.repeat(64);
+ const profile: RemoteRuntimeHostProfile = {
+ id: 'office',
+ name: 'Office',
+ kind: 'remote',
+ transport: {
+ kind: 'ssh',
+ destination: 'operator@runtime.example.com',
+ remotePort: 7443,
+ websocketPath: '/runtime-host',
+ },
+ rootId,
+ };
+ const sshInteractions: string[] = [];
+ const connect = async (interactiveSsh?: boolean) =>
+ connectRuntimeHostCli(
+ {
+ rootPath: '/unused-local-root',
+ profileId: profile.id,
+ ...(interactiveSsh === undefined ? {} : { interactiveSsh }),
+ },
+ {
+ connectRemoteProfile: async (input) => {
+ assert.ok(input.sshInteraction);
+ sshInteractions.push(input.sshInteraction);
+ return {
+ rootId,
+ hostEpoch: 'host-remote',
+ connectionId: `connection-${sshInteractions.length}`,
+ selectedProtocol: 0,
+ closed: new Promise<void>(() => {}),
+ status: async () => ({ state: 'ready' }),
+ subscribeConfigurationChanges: () => () => {},
+ subscribeProjectCatalogChanges: () => () => {},
+ subscribeSessionCatalogChanges: () => () => {},
+ subscribeScheduledTaskChanges: () => () => {},
+ close: async () => {},
+ } as unknown as RuntimeHostConnection;
+ },
+ profileCatalog: singleRemoteProfileCatalog(profile),
+ loadClientInstanceId: async () => '44444444-4444-4444-8444-444444444444',
+ readConnectionCatalog: async () => ({ revision: 1, defaultTarget: null, connections: [] }),
+ },
+ );
+
+ const interactive = await connect(true);
+ await interactive.close();
+ const nonInteractive = await connect();
+ await nonInteractive.close();
+
+ assert.deepEqual(sshInteractions, ['inherit', 'batch']);
+});
+
+test('remote profiles preserve shared compatibility errors', async () => {
const cases: readonly {
- readonly surface: Extract<ClientSurface, 'run' | 'tui'>;
readonly handshake: HostIncompatible;
}[] = [
{
- surface: 'run',
handshake: incompatibleRemoteHandshake({
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH - 1,
}),
},
{
- surface: 'tui',
handshake: incompatibleRemoteHandshake({
protocolMin: RUNTIME_HOST_PROTOCOL_VERSION + 1,
protocolMax: RUNTIME_HOST_PROTOCOL_VERSION + 2,
}),
},
{
- surface: 'run',
handshake: incompatibleRemoteHandshake({
compositionId: 'maka.other-composition',
compositionRevision: 'other-revision',
@@ -343,9 +401,9 @@ test('CLI and TUI remote profiles preserve shared compatibility errors', async (
},
];
- for (const { surface, handshake } of cases) {
+ for (const [index, { handshake }] of cases.entries()) {
const profile: RemoteRuntimeHostProfile = {
- id: `office-${surface}-${handshake.compositionRevision}`,
+ id: `office-${index}-${handshake.compositionRevision}`,
name: 'Office',
kind: 'remote',
transport: { kind: 'tls', url: 'wss://runtime.example.com/runtime-host' },
@@ -354,7 +412,7 @@ test('CLI and TUI remote profiles preserve shared compatibility errors', async (
await assert.rejects(
() =>
connectRuntimeHostCli(
- { rootPath: '/unused-local-root', surface, profileId: profile.id },
+ { rootPath: '/unused-local-root', profileId: profile.id },
{
connectRemoteProfile: (input) =>
connectRemoteRuntimeHostProfile(input, {
diff --git a/packages/cli/src/__tests__/runtime-host-run-command.test.ts b/packages/cli/src/__tests__/runtime-host-run-command.test.ts
index 298e820ad..ea104295f 100644
--- a/packages/cli/src/__tests__/runtime-host-run-command.test.ts
+++ b/packages/cli/src/__tests__/runtime-host-run-command.test.ts
@@ -741,7 +741,6 @@ function runFixture(input: {
connection,
connectionCatalog(),
{
- surface: 'run',
workspaceRoot: '/data',
cwd: '/workspace',
...(input.graph ? { enableAgentGraph: true } : {}),
diff --git a/packages/cli/src/activation-command.ts b/packages/cli/src/activation-command.ts
index fbdb10f24..f290a7d7c 100644
--- a/packages/cli/src/activation-command.ts
+++ b/packages/cli/src/activation-command.ts
@@ -104,7 +104,6 @@ export interface MakaActivationDeps {
}
export interface MakaActivationContextInput {
- readonly surface: 'activation';
readonly workspaceRoot: string;
readonly stateRoot: string;
readonly configRoot: string;
@@ -428,7 +427,6 @@ export async function runMakaActivationCli(
};
try {
context = await deps.createContext({
- surface: 'activation',
workspaceRoot: roots.workspaceRoot,
stateRoot: roots.stateRoot,
configRoot: roots.configRoot,
@@ -810,7 +808,6 @@ async function createRuntimeHostActivationContext(
): Promise<MakaActivationContext> {
const connected = await connectRuntimeHostCli({
rootPath: input.stateRoot,
- surface: 'activation',
});
try {
const target = resolveRuntimeHostCliTarget(connected.catalog, {
@@ -818,7 +815,6 @@ async function createRuntimeHostActivationContext(
...(input.requestedModel ? { model: input.requestedModel } : {}),
});
const runContext = createRuntimeHostRunContext(connected.connection, connected.catalog, {
- surface: 'activation',
workspaceRoot: input.stateRoot,
cwd: input.cwd,
requestedConnectionSlug: target.connection.slug,
@@ -854,7 +850,6 @@ async function createRuntimeHostActivationContext(
async function listRuntimeHostActivationSessions(stateRoot: string): Promise<SessionSummary[]> {
const connected = await connectRuntimeHostCli({
rootPath: stateRoot,
- surface: 'activation',
});
try {
return (await readRuntimeHostSessions(connected.connection)).flatMap((session) =>
diff --git a/packages/cli/src/run-command-core.ts b/packages/cli/src/run-command-core.ts
index e46a5c924..90e88f6d9 100644
--- a/packages/cli/src/run-command-core.ts
+++ b/packages/cli/src/run-command-core.ts
@@ -66,7 +66,6 @@ export interface MakaRunOutcome {
}
export interface MakaRunContextInput {
- surface: 'run' | 'activation';
workspaceRoot: string;
cwd: string;
requestedConnectionSlug?: string;
@@ -266,7 +265,6 @@ export async function runMakaTextCliCore(
let context: MakaRunContext;
try {
context = await deps.createContext({
- surface: 'run',
workspaceRoot,
cwd: selection.cwd,
...(selection.kind === 'existing' || parsed.options.connection
diff --git a/packages/cli/src/runtime-host-access-command.ts b/packages/cli/src/runtime-host-access-command.ts
index aa47692d8..f7871511c 100644
--- a/packages/cli/src/runtime-host-access-command.ts
+++ b/packages/cli/src/runtime-host-access-command.ts
@@ -148,7 +148,6 @@ export async function runRuntimeHostAccessRevokeCli(
async function connectLocalOwner(rootPath: string) {
const result = await connectExistingRuntimeHost({
rootPath,
- surface: 'run',
protocol: PROTOCOL,
});
if (result.kind !== 'connected') {
diff --git a/packages/cli/src/runtime-host-capability-provider-command.ts b/packages/cli/src/runtime-host-capability-provider-command.ts
index 2090d2ac7..353a817e4 100644
--- a/packages/cli/src/runtime-host-capability-provider-command.ts
+++ b/packages/cli/src/runtime-host-capability-provider-command.ts
@@ -148,7 +148,6 @@ async function connectRemoteCapabilityProvider(input: {
const connected = await connectRemoteRuntimeHost({
url: input.url,
credential: input.credential,
- surface: 'capability-provider',
protocol: { min: RUNTIME_HOST_PROTOCOL_VERSION, max: RUNTIME_HOST_PROTOCOL_VERSION },
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
clientInstanceId: input.clientInstanceId,
diff --git a/packages/cli/src/runtime-host-cli-context.ts b/packages/cli/src/runtime-host-cli-context.ts
index 5af5d167a..f9cfebfed 100644
--- a/packages/cli/src/runtime-host-cli-context.ts
+++ b/packages/cli/src/runtime-host-cli-context.ts
@@ -22,7 +22,6 @@ import {
RUNTIME_HOST_COMPATIBILITY_EPOCH,
RUNTIME_HOST_PROTOCOL_VERSION,
type HostRegistration,
- type ClientSurface,
type HostIncompatible,
} from '@maka/runtime-host/protocol';
import { resolveMakaClientDataRoot } from '@maka/storage';
@@ -63,9 +62,9 @@ interface RuntimeHostCliContextDeps {
export async function connectRuntimeHostCli(
input: {
readonly rootPath: string;
- readonly surface: ClientSurface;
readonly profileId?: string;
readonly clientDataRoot?: string;
+ readonly interactiveSsh?: boolean;
},
overrides: Partial<RuntimeHostCliContextDeps> = {},
): Promise<RuntimeHostCliConnectionContext> {
@@ -89,7 +88,6 @@ export async function connectRuntimeHostCli(
);
const connectInput = {
rootPath: input.rootPath,
- surface: input.surface,
protocol: { min: RUNTIME_HOST_PROTOCOL_VERSION, max: RUNTIME_HOST_PROTOCOL_VERSION },
clientInstanceId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
@@ -103,7 +101,6 @@ export async function connectRuntimeHostCli(
return deps.connectRemoteProfile({
profile,
credential: resolvedProfile.credential!,
- surface: input.surface,
clientInstanceId,
sshInteraction,
...(signal ? { signal } : {}),
@@ -128,7 +125,7 @@ export async function connectRuntimeHostCli(
};
const initialConnection = await connect(
undefined,
- input.surface === 'tui' && process.stdin.isTTY && process.stdout.isTTY ? 'inherit' : 'batch',
+ input.interactiveSsh && process.stdin.isTTY && process.stdout.isTTY ? 'inherit' : 'batch',
);
const connection = await createRuntimeHostReconnectingConnection({
initialConnection,
diff --git a/packages/cli/src/runtime-host-project-command.ts b/packages/cli/src/runtime-host-project-command.ts
index 088744c9b..5053902fd 100644
--- a/packages/cli/src/runtime-host-project-command.ts
+++ b/packages/cli/src/runtime-host-project-command.ts
@@ -51,7 +51,6 @@ function defaultDeps(): RuntimeHostProjectCommandDeps {
async function connectLocalOwner(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectExistingRuntimeHost({
rootPath,
- surface: 'run',
protocol: PROTOCOL,
});
if (result.kind !== 'connected') {
diff --git a/packages/cli/src/runtime-host-run-command.ts b/packages/cli/src/runtime-host-run-command.ts
index fb215e2f8..44b557dc2 100644
--- a/packages/cli/src/runtime-host-run-command.ts
+++ b/packages/cli/src/runtime-host-run-command.ts
@@ -122,7 +122,6 @@ function defaultRuntimeHostRunCommandDeps(): RuntimeHostRunCommandDeps {
connect: (rootPath, hostProfileId, clientDataRoot) =>
connectRuntimeHostCli({
rootPath,
- surface: 'run',
...(hostProfileId ? { profileId: hostProfileId } : {}),
clientDataRoot,
}),
diff --git a/packages/cli/src/runtime-host-service-manager.ts b/packages/cli/src/runtime-host-service-manager.ts
index 94201d7fc..503363ae1 100644
--- a/packages/cli/src/runtime-host-service-manager.ts
+++ b/packages/cli/src/runtime-host-service-manager.ts
@@ -542,7 +542,6 @@ async function waitForManagedRuntimeHostReady(
const remaining = deadline - Date.now();
const connected = await connectExistingRuntimeHost({
rootPath: config.rootPath,
- surface: 'run',
protocol: { min: RUNTIME_HOST_PROTOCOL_VERSION, max: RUNTIME_HOST_PROTOCOL_VERSION },
connectTimeoutMs: Math.max(1, Math.min(500, remaining)),
handshakeTimeoutMs: Math.max(1, Math.min(500, remaining)),
diff --git a/packages/cli/src/runtime-host-setup-command.ts b/packages/cli/src/runtime-host-setup-command.ts
index 64d847c81..9e77caa1a 100644
--- a/packages/cli/src/runtime-host-setup-command.ts
+++ b/packages/cli/src/runtime-host-setup-command.ts
@@ -228,7 +228,6 @@ async function verifyRuntimeHostSetupCredential(input: {
credential: input.credential,
expectedRootId: input.rootId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'run',
protocol: { min: RUNTIME_HOST_PROTOCOL_VERSION, max: RUNTIME_HOST_PROTOCOL_VERSION },
});
if (result.kind !== 'connected') {
diff --git a/packages/cli/src/runtime-host-tui-command.ts b/packages/cli/src/runtime-host-tui-command.ts
index 24459b298..b189813fb 100644
--- a/packages/cli/src/runtime-host-tui-command.ts
+++ b/packages/cli/src/runtime-host-tui-command.ts
@@ -139,7 +139,7 @@ async function runFirstRunOnboarding(
const connected = await connectRuntimeHostCli({
clientDataRoot,
rootPath,
- surface: 'tui',
+ interactiveSsh: true,
...(hostProfileId ? { profileId: hostProfileId } : {}),
});
try {
diff --git a/packages/cli/src/runtime-host-tui-context.ts b/packages/cli/src/runtime-host-tui-context.ts
index c722feb13..aafeae689 100644
--- a/packages/cli/src/runtime-host-tui-context.ts
+++ b/packages/cli/src/runtime-host-tui-context.ts
@@ -65,7 +65,7 @@ export async function createRuntimeHostTuiContext(
const connected = await connectRuntimeHostCli({
clientDataRoot: input.clientDataRoot,
rootPath: input.rootPath,
- surface: 'tui',
+ interactiveSsh: true,
...(input.hostProfileId ? { profileId: input.hostProfileId } : {}),
});
const connection = connected.connection;
diff --git a/packages/runtime-host/src/__tests__/agent-graph-coordinator.test.ts b/packages/runtime-host/src/__tests__/agent-graph-coordinator.test.ts
index 1a6e79937..fd7f256f2 100644
--- a/packages/runtime-host/src/__tests__/agent-graph-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/agent-graph-coordinator.test.ts
@@ -547,7 +547,6 @@ function context(): ConnectionContext {
return {
hostEpoch: 'epoch-1',
connectionId: 'connection-1',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/agent-graph-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/agent-graph-two-client-uds.test.ts
index 89b516540..f270eb448 100644
--- a/packages/runtime-host/src/__tests__/agent-graph-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/agent-graph-two-client-uds.test.ts
@@ -97,8 +97,8 @@ test('two Clients query and control one Agent graph through Session invalidation
let tui: RuntimeHostConnection | undefined;
let subscription: RuntimeHostSessionSubscription | undefined;
try {
- desktop = await connect(root, 'desktop');
- tui = await connect(root, 'tui');
+ desktop = await connect(root);
+ tui = await connect(root);
subscription = await desktop.openSessionSubscription({
sessionId: ROOT_SESSION_ID,
transcript: { kind: 'none' },
@@ -125,7 +125,7 @@ test('two Clients query and control one Agent graph through Session invalidation
'active',
);
- tui = await connect(root, 'tui', onLivenessProbe);
+ tui = await connect(root, onLivenessProbe);
const stopped = await tui.request('agent.graph.stop', {
rootSessionId: ROOT_SESSION_ID,
expectedGraphId: GRAPH_ID,
@@ -240,12 +240,10 @@ class FakeAgentGraphAuthority implements GraphAuthority {
async function connect(
rootPath: string,
- surface: 'desktop' | 'tui',
onLivenessProbe?: () => void,
): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: PROTOCOL,
livenessIntervalMs: LIVENESS_INTERVAL_MS,
onLivenessProbe,
diff --git a/packages/runtime-host/src/__tests__/artifact-coordinator.test.ts b/packages/runtime-host/src/__tests__/artifact-coordinator.test.ts
index 9f35d431a..bccd08703 100644
--- a/packages/runtime-host/src/__tests__/artifact-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/artifact-coordinator.test.ts
@@ -14,7 +14,6 @@ import { ARTIFACT_READ_CHUNK_MAX_BYTES } from '../protocol/index.js';
const connectionContext: ConnectionContext = {
hostEpoch: 'host-epoch-1',
connectionId: 'connection-1',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/artifact-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/artifact-two-client-uds.test.ts
index 135cfb4bc..d1bddb802 100644
--- a/packages/runtime-host/src/__tests__/artifact-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/artifact-two-client-uds.test.ts
@@ -50,8 +50,8 @@ test('production Host recovers Artifact publication and preserves deletes across
await assert.rejects(() => stat(residue.stagingPath), { code: 'ENOENT' });
await assert.rejects(() => stat(residue.targetPath), { code: 'ENOENT' });
- const desktop = await connectClient(root, 'desktop');
- const tui = await connectClient(root, 'tui');
+ const desktop = await connectClient(root);
+ const tui = await connectClient(root);
const deleteA = MAX_ARTIFACT_ID;
const deleteB = 'artifact-003';
try {
@@ -204,7 +204,7 @@ test('production Host recovers Artifact publication and preserves deletes across
}
successor = await startHost(root, capability.rootId);
- const observer = await connectClient(root, 'run');
+ const observer = await connectClient(root);
try {
for (const artifactId of [deleteA, deleteB]) {
const getResult = await getArtifact(observer, sessionId, artifactId);
@@ -441,13 +441,9 @@ async function terminateChild(child: ChildProcess): Promise<void> {
);
}
-async function connectClient(
- rootPath: string,
- surface: 'desktop' | 'tui' | 'run',
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: CURRENT_PROTOCOL,
});
assert.equal(result.kind, 'connected');
diff --git a/packages/runtime-host/src/__tests__/authenticated-websocket.test.ts b/packages/runtime-host/src/__tests__/authenticated-websocket.test.ts
index 067c96394..d48d7cab7 100644
--- a/packages/runtime-host/src/__tests__/authenticated-websocket.test.ts
+++ b/packages/runtime-host/src/__tests__/authenticated-websocket.test.ts
@@ -48,9 +48,7 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
let local: RuntimeHostConnection | undefined;
let remote: RuntimeHostConnection | undefined;
try {
- local = requireConnection(
- await connectRuntimeHost({ rootPath: root, surface: 'desktop', protocol: PROTOCOL }),
- );
+ local = requireConnection(await connectRuntimeHost({ rootPath: root, protocol: PROTOCOL }));
const issued = await local.request('access.credential.issue', {
principalKind: 'remote_owner',
principalId: 'remote-device',
@@ -79,7 +77,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
credential,
expectedRootId: capability.rootId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'tui',
protocol: PROTOCOL,
}),
/must not contain credentials, a query, or a fragment/u,
@@ -90,7 +87,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
credential,
expectedRootId: 'f'.repeat(64),
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'tui',
protocol: PROTOCOL,
});
assert.deepEqual(wrongRoot, { kind: 'unavailable', reason: 'root_mismatch' });
@@ -100,7 +96,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
credential,
expectedRootId: capability.rootId,
compositionId: 'test.other',
- surface: 'tui',
protocol: PROTOCOL,
});
assert.equal(wrongComposition.kind, 'incompatible');
@@ -122,7 +117,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
credential,
expectedRootId: capability.rootId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'tui',
protocol: PROTOCOL,
});
assert.equal(connected.kind, 'connected');
@@ -280,7 +274,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
url,
credential: providerCredential,
expectedRootId: capability.rootId,
- surface: 'capability-provider',
protocol: PROTOCOL,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
clientInstanceId: 'remote-provider-instance',
@@ -361,7 +354,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
credential,
expectedRootId: capability.rootId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'tui',
protocol: PROTOCOL,
}),
{ kind: 'unavailable', reason: 'authentication_failed' },
@@ -371,7 +363,6 @@ test('one Local IPC owner and one authenticated WebSocket Client control the sam
credential: replacementCredential,
expectedRootId: capability.rootId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'tui',
protocol: PROTOCOL,
});
assert.equal(replacementConnection.kind, 'connected');
@@ -426,9 +417,7 @@ test('an authenticated WebSocket Client reconnects after service restart to cano
let local: RuntimeHostConnection | undefined;
let remote: Awaited<ReturnType<typeof createRuntimeHostReconnectingConnection>> | undefined;
try {
- local = requireConnection(
- await connectRuntimeHost({ rootPath: root, surface: 'desktop', protocol: PROTOCOL }),
- );
+ local = requireConnection(await connectRuntimeHost({ rootPath: root, protocol: PROTOCOL }));
const issued = await local.request('access.credential.issue', {
principalKind: 'remote_owner',
principalId: 'restart-client',
@@ -467,7 +456,6 @@ test('an authenticated WebSocket Client reconnects after service restart to cano
connectRemoteRuntimeHostProfile({
profile,
credential,
- surface: 'tui',
clientInstanceId: 'restart-client-instance',
...(signal ? { signal } : {}),
connectTimeoutMs: 1_000,
diff --git a/packages/runtime-host/src/__tests__/canonical-session-projection.test.ts b/packages/runtime-host/src/__tests__/canonical-session-projection.test.ts
index 4d742b40a..8e71bc8d0 100644
--- a/packages/runtime-host/src/__tests__/canonical-session-projection.test.ts
+++ b/packages/runtime-host/src/__tests__/canonical-session-projection.test.ts
@@ -614,7 +614,6 @@ function operationContext() {
return {
hostEpoch: 'epoch-1',
connectionId: 'connection-1',
- surface: 'tui' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/client-capability-coordinator.test.ts b/packages/runtime-host/src/__tests__/client-capability-coordinator.test.ts
index a776fbe25..082b221cc 100644
--- a/packages/runtime-host/src/__tests__/client-capability-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/client-capability-coordinator.test.ts
@@ -138,7 +138,7 @@ describe('Host Client Capability coordinator', () => {
},
],
},
- { ...connectionContext('connection-a'), surface: 'capability-provider' },
+ connectionContext('connection-a'),
);
assert.equal(replaced.ok, true);
assert.deepEqual(await coordinator.bindSession('session-a', 'connection-a'), { ok: true });
@@ -199,12 +199,9 @@ describe('Host Client Capability coordinator', () => {
},
],
};
- const providerContext = {
- ...connectionContext('connection-a'),
- surface: 'capability-provider' as const,
- };
+ const trustedContext = connectionContext('connection-a');
assert.equal(
- (await coordinator.handlers['client.capability.replace'](input, providerContext)).ok,
+ (await coordinator.handlers['client.capability.replace'](input, trustedContext)).ok,
true,
);
assert.deepEqual(await coordinator.bindSession('session-a', 'connection-a'), { ok: true });
@@ -237,7 +234,7 @@ describe('Host Client Capability coordinator', () => {
registrationId: 'registration-b',
offers: input.offers.map((offer) => ({ ...offer, affinity: 'call' as const })),
},
- providerContext,
+ trustedContext,
);
assert.equal(rejected.ok, false);
snapshot.release();
@@ -1184,7 +1181,6 @@ function connectionContext(connectionId: string) {
return {
hostEpoch: 'host',
connectionId,
- surface: 'desktop' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/client-capability-uds.test.ts b/packages/runtime-host/src/__tests__/client-capability-uds.test.ts
index bec5724f1..e646773bb 100644
--- a/packages/runtime-host/src/__tests__/client-capability-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/client-capability-uds.test.ts
@@ -65,7 +65,6 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
const connected = await connectRuntimeHost({
rootPath: root,
- surface: 'desktop',
clientInstanceId: 'desktop-installation-a',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -234,7 +233,6 @@ test('unknown Client Capability loads, invokes, and rebinds after UDS reconnect'
const reconnected = await connectRuntimeHost({
rootPath: root,
- surface: 'desktop',
clientInstanceId: 'desktop-installation-a',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/__tests__/connection-effect-coordinator.test.ts b/packages/runtime-host/src/__tests__/connection-effect-coordinator.test.ts
index 7f4293899..55a82c196 100644
--- a/packages/runtime-host/src/__tests__/connection-effect-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/connection-effect-coordinator.test.ts
@@ -24,7 +24,6 @@ import { RuntimePolicyActivationGate } from '../server/runtime-policy-activation
const context: ConnectionContext = {
hostEpoch: 'connection-effect-test-epoch',
connectionId: 'connection-effect-test-client',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/connection-resource.test.ts b/packages/runtime-host/src/__tests__/connection-resource.test.ts
index 494adf97e..fbc6facb2 100644
--- a/packages/runtime-host/src/__tests__/connection-resource.test.ts
+++ b/packages/runtime-host/src/__tests__/connection-resource.test.ts
@@ -35,7 +35,6 @@ for (const settlement of ['resolve', 'reject'] as const) {
credential: 'test-credential',
expectedRootId: ROOT_ID,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: 'tui',
protocol: PROTOCOL,
connectionResource: resource,
});
diff --git a/packages/runtime-host/src/__tests__/connection-session.test.ts b/packages/runtime-host/src/__tests__/connection-session.test.ts
index eea76d9a0..cee2eb1a3 100644
--- a/packages/runtime-host/src/__tests__/connection-session.test.ts
+++ b/packages/runtime-host/src/__tests__/connection-session.test.ts
@@ -60,7 +60,6 @@ function acceptedConnection(connectionId: string) {
hostEpoch: 'host-epoch',
connectionId,
clientInstanceId: 'test-client',
- surface: 'tui' as const,
authority: LOCAL_OWNER_CONNECTION_AUTHORITY,
};
}
@@ -1085,7 +1084,6 @@ async function withRuntimeHost(
connectClient: async () => {
const result = await connectRuntimeHost({
rootPath: root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
});
assert.equal(result.kind, 'connected');
@@ -1117,7 +1115,6 @@ async function openAcceptedTransport(
await writeProtocolFrame(transport, {
kind: 'hello',
clientInstanceId,
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
diff --git a/packages/runtime-host/src/__tests__/daily-review-coordinator.test.ts b/packages/runtime-host/src/__tests__/daily-review-coordinator.test.ts
index de0666753..193b1e2a3 100644
--- a/packages/runtime-host/src/__tests__/daily-review-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/daily-review-coordinator.test.ts
@@ -13,7 +13,6 @@ import { HostDailyReviewCoordinator } from '../server/daily-review-coordinator.j
const CONTEXT: ConnectionContext = {
hostEpoch: 'host-epoch',
connectionId: 'connection-id',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/daily-review-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/daily-review-two-client-uds.test.ts
index 325788c9d..22c88952d 100644
--- a/packages/runtime-host/src/__tests__/daily-review-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/daily-review-two-client-uds.test.ts
@@ -63,7 +63,7 @@ test('two Clients share Daily Review config, generation, and restart recovery',
composition: defineInteractiveRuntimeHostComposition(createExecutionRuntimeHostComposition),
});
owner = undefined;
- [desktop, tui] = await Promise.all([connect(root, 'desktop'), connect(root, 'tui')]);
+ [desktop, tui] = await Promise.all([connect(root), connect(root)]);
const initial = await desktop.queryDailyReview({ kind: 'config' });
assert.deepEqual(initial, {
@@ -143,7 +143,7 @@ test('two Clients share Daily Review config, generation, and restart recovery',
composition: defineInteractiveRuntimeHostComposition(createExecutionRuntimeHostComposition),
});
owner = undefined;
- tui = await connect(root, 'tui');
+ tui = await connect(root);
assert.deepEqual(
await tui.queryDailyReview({
kind: 'archive',
@@ -167,13 +167,9 @@ test('two Clients share Daily Review config, generation, and restart recovery',
}
});
-async function connect(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
+async function connect(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: PROTOCOL,
});
assert.equal(result.kind, 'connected');
diff --git a/packages/runtime-host/src/__tests__/deep-research-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/deep-research-two-client-uds.test.ts
index a85f50ae8..ade14c6f1 100644
--- a/packages/runtime-host/src/__tests__/deep-research-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/deep-research-two-client-uds.test.ts
@@ -66,7 +66,7 @@ test('two Clients and a restarted production Host share one Deep Research projec
composition: defineInteractiveRuntimeHostComposition(createExecutionRuntimeHostComposition),
});
owner = undefined;
- [desktop, tui] = await Promise.all([connect(root, 'desktop'), connect(root, 'tui')]);
+ [desktop, tui] = await Promise.all([connect(root), connect(root)]);
const [desktopProjection, tuiProjection] = await Promise.all([
desktop.queryDeepResearch({ sessionId: session.id }),
@@ -107,7 +107,7 @@ test('two Clients and a restarted production Host share one Deep Research projec
composition: defineInteractiveRuntimeHostComposition(createExecutionRuntimeHostComposition),
});
owner = undefined;
- tui = await connect(root, 'tui');
+ tui = await connect(root);
assert.deepEqual(await tui.queryDeepResearch({ sessionId: session.id }), desktopProjection);
} finally {
@@ -118,11 +118,8 @@ test('two Clients and a restarted production Host share one Deep Research projec
}
});
-async function connect(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
- const result = await connectRuntimeHost({ rootPath, surface, protocol: PROTOCOL });
+async function connect(rootPath: string): Promise<RuntimeHostConnection> {
+ const result = await connectRuntimeHost({ rootPath, protocol: PROTOCOL });
assert.equal(result.kind, 'connected');
if (result.kind !== 'connected') throw new Error('Unable to connect to Runtime Host');
return result.connection;
diff --git a/packages/runtime-host/src/__tests__/execution-composition.test.ts b/packages/runtime-host/src/__tests__/execution-composition.test.ts
index ad6ca2bb1..6e474e8c6 100644
--- a/packages/runtime-host/src/__tests__/execution-composition.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-composition.test.ts
@@ -262,7 +262,6 @@ test('hosted execution settles while its tracked environment resource remains ve
const operationContext = {
hostEpoch: 'hosted-environment-test',
connectionId: 'hosted-environment-test',
- surface: 'run' as const,
principal: 'runtime_host' as const,
acquireResidency: () => ({ release() {} }),
};
@@ -360,7 +359,6 @@ test('production composition commits automatic titles through Host-owned Session
{
hostEpoch: 'execution-composition-test',
connectionId: 'title-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
},
@@ -394,7 +392,6 @@ test('a legacy fake-backend session is refused with the product reason, not a re
{
hostEpoch: 'execution-composition-test',
connectionId: 'legacy-fake-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
},
@@ -432,7 +429,6 @@ test('production composition orphans ownerless ShellRuns before serving Resource
{
hostEpoch: 'execution-composition-test',
connectionId: 'recovery-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
},
@@ -485,7 +481,6 @@ test('production Skill catalog resolves a Graph child durable tool surface', asy
{
hostEpoch: 'execution-composition-test',
connectionId: 'graph-child-skill-client',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
},
@@ -521,7 +516,6 @@ test('new Full Access Plan Skill previews use the mutating tool surface', async
const connection = {
hostEpoch: 'execution-composition-test',
connectionId: 'new-session-skill-client',
- surface: 'desktop' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release() {} }),
};
@@ -642,7 +636,6 @@ test('Skill capability previews omit unavailable Tavily search surfaces', async
const connectionContext = {
hostEpoch: 'execution-composition-test',
connectionId: 'web-search-skill-preview-client',
- surface: 'desktop' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release() {} }),
};
@@ -779,7 +772,6 @@ test('production composition validates graph stop before aborting a claimed chil
const clientContext = {
hostEpoch: 'execution-composition-test',
connectionId: 'graph-stop-client',
- surface: 'tui' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/execution-host-continuation.test.ts b/packages/runtime-host/src/__tests__/execution-host-continuation.test.ts
index 3da0f75b5..968d157a9 100644
--- a/packages/runtime-host/src/__tests__/execution-host-continuation.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-host-continuation.test.ts
@@ -13,8 +13,8 @@ test('two Clients idempotently start one Host-owned safe-boundary continuation',
await withExecutionRoot(async (fixture) => {
const source = await fixture.seedSafeBoundaryContinuationSource();
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const turnId = 'turn-safe-boundary-continuation';
let clientsClosed = false;
let hostStopped = false;
@@ -104,7 +104,7 @@ test('startup repairs a continuation Run created before its durable start', asyn
await withExecutionRoot(async (fixture) => {
const crash = await fixture.seedSafeBoundaryContinuationCrash('after_run_created');
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
try {
const repaired = await client.queryTurn({
sessionId: fixture.sessionId,
@@ -138,7 +138,7 @@ test('startup repairs a continuation claim committed before its target Run', asy
'after_continuation_claim_committed',
);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
let clientClosed = false;
let hostStopped = false;
try {
@@ -171,7 +171,7 @@ test('startup parks a provider-indeterminate continuation without blocking the H
'after_continuation_start_committed',
);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
try {
const indeterminate = await client.queryTurn({
sessionId: fixture.sessionId,
@@ -255,7 +255,7 @@ test('startup parks a provider-indeterminate continuation when resume is disable
'after_continuation_start_committed',
);
const host = await fixture.startHost(undefined, false);
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
try {
const indeterminate = await client.queryTurn({
sessionId: fixture.sessionId,
@@ -295,7 +295,7 @@ test('startup parks a pre-claim continuation whose Client Capability is absent',
const requiredToolName = mcpProxyToolName('resume_fixture', 'inspect');
const pending = await fixture.seedPendingSafeBoundaryContinuation(requiredToolName);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
try {
assert.deepEqual(
await client.queryTurnResume({
@@ -364,7 +364,7 @@ test('Runtime Host keeps safe-boundary continuation opt-in', async () => {
const source = await fixture.seedSafeBoundaryContinuationSource();
const targetTurnId = 'turn-disabled-safe-boundary-continuation';
const host = await fixture.startHost(undefined, false);
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
let clientClosed = false;
let hostStopped = false;
try {
@@ -414,7 +414,7 @@ test('resume query previews the initiating Client Capability without binding it'
const requiredToolName = mcpProxyToolName(serverId, toolName);
const source = await fixture.seedSafeBoundaryContinuationSource(requiredToolName);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
const provider = resumeFixtureProvider(serverId, [toolName]);
try {
assert.deepEqual(await client.queryTurnResume({ sessionId: fixture.sessionId }), {
diff --git a/packages/runtime-host/src/__tests__/execution-host-message.test.ts b/packages/runtime-host/src/__tests__/execution-host-message.test.ts
index 7bbdf059d..9f69b0c2a 100644
--- a/packages/runtime-host/src/__tests__/execution-host-message.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-host-message.test.ts
@@ -98,8 +98,8 @@ import {
test('steering becomes durable and ordered followups automatically start the next root', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const firstTurnId = randomUUID();
await first.startTurn({
sessionId: fixture.sessionId,
@@ -226,8 +226,8 @@ test('steering becomes durable and ordered followups automatically start the nex
test('explicit retract is durable across connections and prevents successor admission', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const turnId = randomUUID();
const started = requireStartedTurn(
await first.startTurn({
@@ -258,7 +258,7 @@ test('explicit retract is durable across connections and prevents successor admi
);
await second.close();
- const retrying = await connectClient(fixture.root, 'run');
+ const retrying = await connectClient(fixture.root);
assert.deepEqual(await retrying.request('queue.retract', retractInput), retracted);
const terminal = await first.stopTurn({
@@ -282,8 +282,8 @@ test('explicit retract is durable across connections and prevents successor admi
test('interrupt atomically retracts queued followup, stops the exact run, and is idempotent', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const turnId = randomUUID();
const started = requireStartedTurn(
await first.startTurn({
@@ -349,7 +349,7 @@ test('interrupt atomically retracts queued followup, stops the exact run, and is
test('old-Epoch Message submit returns only exact durable outcomes', async () => {
await withExecutionRoot(async (fixture) => {
const firstHost = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
+ const first = await connectClient(fixture.root);
const rootMessageId = randomUUID();
const rootContent = { text: `durable root ${'x'.repeat(360)}` };
const rootResult = await first.request('turn.message.submit', {
@@ -376,7 +376,7 @@ test('old-Epoch Message submit returns only exact durable outcomes', async () =>
await fixture.stopHost(firstHost);
const successorHost = await fixture.startHost();
- const successor = await connectClient(fixture.root, 'run');
+ const successor = await connectClient(fixture.root);
assert.deepEqual(
await successor.request('turn.message.submit', {
originHostEpoch: firstHost.hostEpoch,
diff --git a/packages/runtime-host/src/__tests__/execution-host-queue.test.ts b/packages/runtime-host/src/__tests__/execution-host-queue.test.ts
index 99871e061..5019f7bb3 100644
--- a/packages/runtime-host/src/__tests__/execution-host-queue.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-host-queue.test.ts
@@ -98,8 +98,8 @@ import {
test('subscribed Clients share one canonical queue and ordered root handoff', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const desktop = await connectClient(fixture.root, 'desktop');
- const tui = await connectClient(fixture.root, 'tui');
+ const desktop = await connectClient(fixture.root);
+ const tui = await connectClient(fixture.root);
const desktopSubscription = await desktop.openSessionSubscription({
sessionId: fixture.sessionId,
transcript: { kind: 'none' },
@@ -199,8 +199,8 @@ test('subscribed Clients share one canonical queue and ordered root handoff', as
test('concurrent root admission for one Session has a single winner', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const turnIds = [randomUUID(), randomUUID()] as const;
const outcomes = await Promise.allSettled([
@@ -250,7 +250,7 @@ test('an archived Session rejects a new Turn before durable admission', async ()
await withExecutionRoot(async (fixture) => {
await fixture.archiveSession();
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
const turnId = randomUUID();
await assert.rejects(
@@ -277,7 +277,7 @@ test('an archived Session rejects a new Turn before durable admission', async ()
test('a killed Host is recovered exactly once before its successor becomes ready', async () => {
await withExecutionRoot(async (fixture) => {
const firstHost = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
+ const first = await connectClient(fixture.root);
const firstSubscription = await first.openSessionSubscription({
sessionId: fixture.sessionId,
transcript: { kind: 'none' },
@@ -309,7 +309,7 @@ test('a killed Host is recovered exactly once before its successor becomes ready
await first.closed;
await firstProbe.waitForFailure('connection_closed');
const secondHost = await fixture.startHost();
- const second = await connectClient(fixture.root, 'tui');
+ const second = await connectClient(fixture.root);
const recoveredSubscription = await second.openSessionSubscription({
sessionId: fixture.sessionId,
transcript: { kind: 'none' },
@@ -353,7 +353,7 @@ test('a killed Host is recovered exactly once before its successor becomes ready
await fixture.stopHost(secondHost);
const thirdHost = await fixture.startHost();
- const third = await connectClient(fixture.root, 'run');
+ const third = await connectClient(fixture.root);
const stable = await third.queryTurn({
sessionId: fixture.sessionId,
turnId,
@@ -382,7 +382,7 @@ test('a killed Host is recovered exactly once before its successor becomes ready
test('graceful Host shutdown stops and drains an active Turn before releasing ownership', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
const turnId = randomUUID();
const started = requireStartedTurn(
await client.startTurn({
@@ -397,7 +397,7 @@ test('graceful Host shutdown stops and drains an active Turn before releasing ow
await client.closed;
const successor = await fixture.startHost();
- const observer = await connectClient(fixture.root, 'tui');
+ const observer = await connectClient(fixture.root);
const stable = await observer.queryTurn({
sessionId: fixture.sessionId,
turnId,
@@ -423,7 +423,7 @@ test('a durable admission without a Run resumes before the Host becomes ready',
const quotes = quotedContent('recover pending admission');
const { runId } = await fixture.seedAdmission(turnId, quotes);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'tui');
+ const client = await connectClient(fixture.root);
const recovered = await client.queryTurn({
sessionId: fixture.sessionId,
@@ -471,7 +471,7 @@ test('startup recovery compares an existing quoted UserMessage canonically', asy
const content = quotedContent('recover existing message');
const { runId, userMessageId } = await fixture.seedRunWithUserMessage(turnId, content);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'tui');
+ const client = await connectClient(fixture.root);
const recovered = await client.queryTurn({
sessionId: fixture.sessionId,
@@ -498,7 +498,7 @@ test('startup recovery restores the admitted UserMessage before terminalizing it
'recover the admitted message',
);
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'tui');
+ const client = await connectClient(fixture.root);
const recovered = await client.queryTurn({
sessionId: fixture.sessionId,
diff --git a/packages/runtime-host/src/__tests__/execution-host-recovery.test.ts b/packages/runtime-host/src/__tests__/execution-host-recovery.test.ts
index d39180a7e..953703729 100644
--- a/packages/runtime-host/src/__tests__/execution-host-recovery.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-host-recovery.test.ts
@@ -103,7 +103,7 @@ test('retry after a discarded turn.start response reuses the durable semantic ad
turnId,
text,
});
- const observer = await connectClient(fixture.root, 'tui');
+ const observer = await connectClient(fixture.root);
const committed = await waitForTurn(observer, fixture.sessionId, turnId);
dropped.abort();
@@ -130,7 +130,7 @@ test('retry after a discarded turn.start response reuses the durable semantic ad
await fixture.killHost(host);
const successorHost = await fixture.startHost();
- const successorClient = await connectClient(fixture.root, 'run');
+ const successorClient = await connectClient(fixture.root);
assert.deepEqual(
requireStartedTurn(
await successorClient.startTurn({
@@ -167,7 +167,7 @@ test('retry after a discarded turn.start response reuses the durable semantic ad
test('startup recovery replays an admitted regenerate with its source lineage', async () => {
await withExecutionRoot(async (fixture) => {
const firstHost = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
+ const first = await connectClient(fixture.root);
const sourceTurnId = randomUUID();
const regeneratedTurnId = randomUUID();
await first.startTurn({
@@ -184,7 +184,7 @@ test('startup recovery replays an admitted regenerate with its source lineage',
regeneratedTurnId,
);
const successorHost = await fixture.startHost();
- const successor = await connectClient(fixture.root, 'tui');
+ const successor = await connectClient(fixture.root);
const terminal = await waitForTerminalTurn(successor, fixture.sessionId, regeneratedTurnId);
assert.equal(terminal.runId, admitted.runId);
await successor.close();
@@ -201,7 +201,7 @@ test('startup recovery replays an admitted regenerate with its source lineage',
test('a fresh quoted Turn preserves durable and Runtime handoff content', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
const turnId = randomUUID();
const content = quotedContent('fresh quoted turn');
@@ -223,8 +223,8 @@ test('a fresh quoted Turn preserves durable and Runtime handoff content', async
test('same idle Message submit is connection-independent and starts one canonical root', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const messageId = randomUUID();
const content = {
text: '<context>canonical model input</context>',
@@ -283,7 +283,7 @@ test('same idle Message submit is connection-independent and starts one canonica
test('stale Session operations return not_found across the SQLite-backed UDS Host boundary', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'desktop');
+ const client = await connectClient(fixture.root);
const staleSessionId = randomUUID();
try {
await assert.rejects(
diff --git a/packages/runtime-host/src/__tests__/execution-host.test.ts b/packages/runtime-host/src/__tests__/execution-host.test.ts
index 9dcd2f325..d6837ac7c 100644
--- a/packages/runtime-host/src/__tests__/execution-host.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-host.test.ts
@@ -102,8 +102,8 @@ test('production Host resumes a Session through the ScheduledTask authority', {
}, async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const desktop = await connectClient(fixture.root, 'desktop');
- const tui = await connectClient(fixture.root, 'tui');
+ const desktop = await connectClient(fixture.root);
+ const tui = await connectClient(fixture.root);
try {
const heartbeat = await desktop.request('scheduled-task.mutate', {
kind: 'create',
@@ -206,8 +206,8 @@ test('dual UDS Clients query persisted Task Ledger tool-port mutations across Ho
});
const host = await fixture.startHost();
- const desktop = await connectClient(fixture.root, 'desktop');
- const tui = await connectClient(fixture.root, 'tui');
+ const desktop = await connectClient(fixture.root);
+ const tui = await connectClient(fixture.root);
let staleContinuation:
| {
revision: TaskLedgerRevision;
@@ -270,7 +270,7 @@ test('dual UDS Clients query persisted Task Ledger tool-port mutations across Ho
});
const successorHost = await fixture.startHost();
- const successor = await connectClient(fixture.root, 'desktop');
+ const successor = await connectClient(fixture.root);
try {
const continued = await successor.request('task.ledger.query', {
kind: 'list_continue',
@@ -380,8 +380,8 @@ async function seedDispatchedClientCapability(
test('two UDS Clients share one Runtime Policy authority and CAS winner', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
try {
const initial = await first.request('runtime.policy.query', {});
assert.deepEqual(await second.request('runtime.policy.query', {}), initial);
@@ -423,8 +423,8 @@ test('two UDS Clients await slow connection effects against one canonical catalo
const secret = 'connection-effect-secret';
const connection = await fixture.seedConnectionEffect(provider.baseUrl, secret);
const host = await fixture.startHost();
- const desktop = await connectClient(fixture.root, 'desktop');
- const tui = await connectClient(fixture.root, 'tui');
+ const desktop = await connectClient(fixture.root);
+ const tui = await connectClient(fixture.root);
try {
assert.equal(desktop.hostEpoch, tui.hostEpoch);
assert.notEqual(desktop.connectionId, tui.connectionId);
@@ -529,8 +529,8 @@ test('two UDS Clients await slow connection effects against one canonical catalo
test('two Clients share one execution after the starting Client disconnects', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const turnId = randomUUID();
const started = requireStartedTurn(
@@ -689,7 +689,7 @@ test('two Clients share one execution after the starting Client disconnects', as
test('regenerate replays the durable source content with one recoverable root identity', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const client = await connectClient(fixture.root, 'tui');
+ const client = await connectClient(fixture.root);
const sourceTurnId = randomUUID();
const regeneratedTurnId = randomUUID();
try {
@@ -744,7 +744,7 @@ test('regenerate replays the durable source content with one recoverable root id
test('regenerate rejects self-source and legacy target collisions without draining Host', async () => {
await withExecutionRoot(async (fixture) => {
const firstHost = await fixture.startHost();
- const first = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
const sourceTurnId = randomUUID();
await first.startTurn({
sessionId: fixture.sessionId,
@@ -765,7 +765,7 @@ test('regenerate rejects self-source and legacy target collisions without draini
const legacy = await fixture.seedSafeBoundaryContinuationSource();
const secondHost = await fixture.startHost();
- const second = await connectClient(fixture.root, 'desktop');
+ const second = await connectClient(fixture.root);
try {
await assert.rejects(
second.regenerateTurn({
@@ -800,8 +800,8 @@ test('regenerate rejects self-source and legacy target collisions without draini
test('context actions share root admission and expose backend capability honestly', async () => {
await withExecutionRoot(async (fixture) => {
const host = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
- const second = await connectClient(fixture.root, 'tui');
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const turnId = randomUUID();
const unavailableTurnId = randomUUID();
try {
@@ -855,7 +855,7 @@ test('context actions share root admission and expose backend capability honestl
test('a disconnected Client leaves a durable Interaction that another Client can answer', async () => {
await withExecutionRoot(async (fixture) => {
const firstHost = await fixture.startHost();
- const first = await connectClient(fixture.root, 'desktop');
+ const first = await connectClient(fixture.root);
const turnId = randomUUID();
const started = requireStartedTurn(
await first.startTurn({
@@ -866,7 +866,7 @@ test('a disconnected Client leaves a durable Interaction that another Client can
);
await first.close();
- const second = await connectClient(fixture.root, 'tui');
+ const second = await connectClient(fixture.root);
const subscription = await second.openSessionSubscription({
sessionId: fixture.sessionId,
transcript: { kind: 'none' },
@@ -936,7 +936,7 @@ test('a disconnected Client leaves a durable Interaction that another Client can
await fixture.stopHost(firstHost);
const secondHost = await fixture.startHost();
- const observer = await connectClient(fixture.root, 'run');
+ const observer = await connectClient(fixture.root);
assert.deepEqual(
await observer.request('interaction.query', {
sessionId: fixture.sessionId,
@@ -961,9 +961,9 @@ test('a disconnected Client leaves a durable Interaction that another Client can
test('two UDS Clients settle one hosted sandbox boundary and resume its exact Run', async () => {
await withExecutionRoot(async (fixture) => {
const firstHost = await fixture.startHost();
- const starter = await connectClient(fixture.root, 'desktop');
- const first = await connectClient(fixture.root, 'tui');
- const second = await connectClient(fixture.root, 'run');
+ const starter = await connectClient(fixture.root);
+ const first = await connectClient(fixture.root);
+ const second = await connectClient(fixture.root);
const subscription = await first.openSessionSubscription({
sessionId: fixture.sessionId,
transcript: { kind: 'none' },
@@ -1028,7 +1028,7 @@ test('two UDS Clients settle one hosted sandbox boundary and resume its exact Ru
await fixture.stopHost(firstHost);
const secondHost = await fixture.startHost();
- const observer = await connectClient(fixture.root, 'desktop');
+ const observer = await connectClient(fixture.root);
assert.deepEqual(
await observer.request('interaction.query', {
sessionId: fixture.sessionId,
diff --git a/packages/runtime-host/src/__tests__/execution-inspect-coordinator.test.ts b/packages/runtime-host/src/__tests__/execution-inspect-coordinator.test.ts
index 6b7937f11..704e54c66 100644
--- a/packages/runtime-host/src/__tests__/execution-inspect-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-inspect-coordinator.test.ts
@@ -445,7 +445,6 @@ function connectionContext() {
return {
hostEpoch: 'host-1',
connectionId: 'connection-1',
- surface: 'inspect' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/execution-inspect-uds.test.ts b/packages/runtime-host/src/__tests__/execution-inspect-uds.test.ts
index b9af046ec..cde2845ed 100644
--- a/packages/runtime-host/src/__tests__/execution-inspect-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-inspect-uds.test.ts
@@ -45,7 +45,6 @@ test('a live Host serves Interactive inspection over its real endpoint while ret
const connected = await connectExistingRuntimeHost({
rootPath: root,
- surface: 'inspect',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/__tests__/execution-model-composition.test.ts b/packages/runtime-host/src/__tests__/execution-model-composition.test.ts
index 2f6695fcf..a8fadde4a 100644
--- a/packages/runtime-host/src/__tests__/execution-model-composition.test.ts
+++ b/packages/runtime-host/src/__tests__/execution-model-composition.test.ts
@@ -572,7 +572,6 @@ test('production backend creation continues after a Session Client Capability is
const context: ConnectionContext = {
hostEpoch: 'backend-creation-epoch',
connectionId: 'provider-a',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
@@ -660,7 +659,6 @@ test('production backend preserves coordinator Client Capability semantics acros
const context = {
hostEpoch: 'client-capability-host-epoch',
connectionId: 'client-capability-provider',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
} satisfies ConnectionContext;
@@ -817,7 +815,6 @@ test('hosted execution freezes the headless coding provider wire contract', asyn
const context: ConnectionContext = {
hostEpoch: 'hosted-profile-wire-epoch',
connectionId: 'hosted-profile-wire-client',
- surface: 'run',
principal: 'runtime_host',
acquireResidency: () => residencies.acquire('hosted-profile-wire-operation'),
};
@@ -972,7 +969,6 @@ test('production Host executes a canonical ai-sdk Session against a real provide
const connectionContext: ConnectionContext = {
hostEpoch: 'real-model-test-epoch',
connectionId: 'real-model-test-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
@@ -1319,7 +1315,6 @@ test('production Host executes and durably supervises an Agent Graph over a real
const context: ConnectionContext = {
hostEpoch: 'agent-graph-test-epoch',
connectionId: 'agent-graph-test-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => {
liveResidencies += 1;
@@ -1521,7 +1516,6 @@ test('production Host executes a durable runnable child with an exact tool ceili
const context: ConnectionContext = {
hostEpoch: 'child-agent-test-epoch',
connectionId: 'child-agent-test-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
@@ -1701,7 +1695,6 @@ test('production Host publishes and retires an implementation child patch', asyn
const context: ConnectionContext = {
hostEpoch: 'child-agent-test-epoch',
connectionId: 'child-agent-test-client',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/external-session-coordinator.test.ts b/packages/runtime-host/src/__tests__/external-session-coordinator.test.ts
index 7848588f2..7cbcd21f7 100644
--- a/packages/runtime-host/src/__tests__/external-session-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/external-session-coordinator.test.ts
@@ -18,7 +18,6 @@ import { SessionAdmissionGate } from '../server/session-admission-gate.js';
const context: ConnectionContext = {
hostEpoch: 'external-session-test-epoch',
connectionId: 'external-session-test-client',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/fixtures/connect-client.ts b/packages/runtime-host/src/__tests__/fixtures/connect-client.ts
index 00385874a..d723e63b1 100644
--- a/packages/runtime-host/src/__tests__/fixtures/connect-client.ts
+++ b/packages/runtime-host/src/__tests__/fixtures/connect-client.ts
@@ -3,12 +3,11 @@ import { launchDetachedRuntimeHostCandidate } from '../../client/launcher.js';
import {
INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
RUNTIME_HOST_PROTOCOL_VERSION,
- type ClientSurface,
} from '../../protocol/index.js';
-const [rootPath, surface] = process.argv.slice(2);
-if (!rootPath || !isClientSurface(surface)) {
- throw new Error('usage: connect-client <root> <desktop|tui>');
+const [rootPath] = process.argv.slice(2);
+if (!rootPath) {
+ throw new Error('usage: connect-client <root>');
}
const candidatePids: number[] = [];
@@ -16,7 +15,6 @@ const candidateEntrypoint = new URL('./kernel-candidate.js', import.meta.url);
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath,
- surface,
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -64,7 +62,3 @@ process.on('message', (message) => {
if (message === 'close') close();
});
process.once('disconnect', close);
-
-function isClientSurface(value: string | undefined): value is ClientSurface {
- return value === 'desktop' || value === 'tui' || value === 'capability-provider';
-}
diff --git a/packages/runtime-host/src/__tests__/fixtures/electron-connect-parent.ts b/packages/runtime-host/src/__tests__/fixtures/electron-connect-parent.ts
index 2edac0f90..2a5e84bad 100644
--- a/packages/runtime-host/src/__tests__/fixtures/electron-connect-parent.ts
+++ b/packages/runtime-host/src/__tests__/fixtures/electron-connect-parent.ts
@@ -19,7 +19,6 @@ const candidateEntrypoint = new URL('./kernel-candidate.js', import.meta.url);
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath,
- surface: 'desktop',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/__tests__/fixtures/execution-host-suite.ts b/packages/runtime-host/src/__tests__/fixtures/execution-host-suite.ts
index ca60aaca7..88289e779 100644
--- a/packages/runtime-host/src/__tests__/fixtures/execution-host-suite.ts
+++ b/packages/runtime-host/src/__tests__/fixtures/execution-host-suite.ts
@@ -1040,13 +1040,9 @@ export async function withExecutionRoot(
}
}
-export async function connectClient(
- rootPath: string,
- surface: 'desktop' | 'tui' | 'run',
-): Promise<RuntimeHostConnection> {
+export async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: CURRENT_PROTOCOL,
});
assert.equal(result.kind, 'connected');
@@ -1124,7 +1120,6 @@ export async function sendStartWithoutReadingResponse(
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: randomUUID(),
- surface: 'desktop',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
diff --git a/packages/runtime-host/src/__tests__/framed-transport.test.ts b/packages/runtime-host/src/__tests__/framed-transport.test.ts
index af8bbd784..7d5109d0c 100644
--- a/packages/runtime-host/src/__tests__/framed-transport.test.ts
+++ b/packages/runtime-host/src/__tests__/framed-transport.test.ts
@@ -113,7 +113,6 @@ test('decodes split UTF-8 and coalesced Local IPC frames', async () => {
const hello = {
kind: 'hello' as const,
clientInstanceId: '客户端',
- surface: 'tui' as const,
protocolMin: RUNTIME_HOST_PROTOCOL_VERSION,
protocolMax: RUNTIME_HOST_PROTOCOL_VERSION,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
diff --git a/packages/runtime-host/src/__tests__/goal-coordinator.test.ts b/packages/runtime-host/src/__tests__/goal-coordinator.test.ts
index 09bf58ef8..3bfd0fbf7 100644
--- a/packages/runtime-host/src/__tests__/goal-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/goal-coordinator.test.ts
@@ -529,7 +529,6 @@ function operationContext(connectionId: string) {
return {
hostEpoch: 'epoch-1',
connectionId,
- surface: 'tui' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/goal-root-authority.test.ts b/packages/runtime-host/src/__tests__/goal-root-authority.test.ts
index 3f52a6f91..fee1f6f99 100644
--- a/packages/runtime-host/src/__tests__/goal-root-authority.test.ts
+++ b/packages/runtime-host/src/__tests__/goal-root-authority.test.ts
@@ -760,7 +760,6 @@ function operationContext() {
return {
hostEpoch: 'goal-root-epoch',
connectionId: 'connection-1',
- surface: 'tui' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/handshake-compatibility.test.ts b/packages/runtime-host/src/__tests__/handshake-compatibility.test.ts
index 665308a5d..fd1ac64a4 100644
--- a/packages/runtime-host/src/__tests__/handshake-compatibility.test.ts
+++ b/packages/runtime-host/src/__tests__/handshake-compatibility.test.ts
@@ -29,6 +29,33 @@ const PROTOCOL = {
max: RUNTIME_HOST_PROTOCOL_VERSION,
} as const;
+test('emits the legacy desktop surface shim in the raw Client hello', async () => {
+ await withForgedHandshakePeer(
+ async (transport, hostEpoch, rootId) => {
+ const rawHello = await transport.read(2_000);
+ assert.ok(rawHello && typeof rawHello === 'object');
+ assert.equal((rawHello as Record<string, unknown>).surface, 'desktop');
+ const hello = decodeClientFrame(rawHello);
+ assert.ok('kind' in hello && hello.kind === 'hello');
+ await writeProtocolFrame(transport, {
+ kind: 'accepted',
+ rootId,
+ hostEpoch,
+ connectionId: 'forged-current-connection',
+ selectedProtocol: RUNTIME_HOST_PROTOCOL_VERSION,
+ compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
+ compositionId: 'maka.interactive',
+ compositionRevision: '1',
+ state: 'ready',
+ });
+ await transport.closed;
+ },
+ async (result) => {
+ assert.equal(result.kind, 'connected');
+ },
+ );
+});
+
test('rejects an epoch-23 Host before any domain command', async () => {
let admittedRequest: RequestFrame | undefined;
await withForgedHandshakePeer(
@@ -126,7 +153,6 @@ async function withForgedHandshakePeer(
capability,
controlDirectory,
clientInstanceId: randomUUID(),
- surface: 'tui',
protocol: PROTOCOL,
});
if (resolved.kind === 'election_deadline_elapsed') {
diff --git a/packages/runtime-host/src/__tests__/host-kernel.test.ts b/packages/runtime-host/src/__tests__/host-kernel.test.ts
index bab866326..94b284bbe 100644
--- a/packages/runtime-host/src/__tests__/host-kernel.test.ts
+++ b/packages/runtime-host/src/__tests__/host-kernel.test.ts
@@ -48,7 +48,6 @@ import {
RUNTIME_HOST_MAX_MESSAGE_BYTES,
RUNTIME_HOST_PROTOCOL_VERSION,
type ClientFrame,
- type ClientSurface,
} from '../protocol/index.js';
import {
RuntimeHostKernel,
@@ -124,7 +123,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -152,7 +150,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -185,7 +182,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -213,7 +209,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -268,7 +263,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -318,7 +312,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'inspect',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -359,7 +352,6 @@ describe('non-serving Runtime Host kernel', () => {
const connected = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
generation: 'desktop-current',
});
@@ -379,7 +371,6 @@ describe('non-serving Runtime Host kernel', () => {
const incompatible = await connectOrSpawnRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'tui',
protocol: LEGACY_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -506,7 +497,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: 'lifecycle-test',
- surface: 'inspect',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -622,7 +612,7 @@ describe('non-serving Runtime Host kernel', () => {
return testComposition();
}),
});
- const connected = await retryConnect(paths, CURRENT_PROTOCOL, 'desktop');
+ const connected = await retryConnect(paths, CURRENT_PROTOCOL);
assert.equal(connected.kind, 'connected');
if (connected.kind !== 'connected') return;
@@ -674,7 +664,6 @@ describe('non-serving Runtime Host kernel', () => {
const observer = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
});
assert.equal(observer.kind, 'connected');
@@ -682,7 +671,6 @@ describe('non-serving Runtime Host kernel', () => {
const blocked = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
generation: 'desktop-new',
takeoverHostEpoch: candidate.host.hostEpoch,
@@ -699,7 +687,6 @@ describe('non-serving Runtime Host kernel', () => {
await observer.connection.close();
const restartable = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
generation: 'desktop-new',
});
@@ -709,7 +696,6 @@ describe('non-serving Runtime Host kernel', () => {
}
const takeover = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
generation: 'desktop-new',
takeoverHostEpoch: candidate.host.hostEpoch,
@@ -726,7 +712,6 @@ describe('non-serving Runtime Host kernel', () => {
if (replacement.kind !== 'winner') return;
const attached = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
generation: 'desktop-new',
});
@@ -1002,7 +987,7 @@ describe('non-serving Runtime Host kernel', () => {
});
assert.equal(candidate.kind, 'winner');
if (candidate.kind !== 'winner') return;
- const resident = await retryConnect(paths, CURRENT_PROTOCOL, 'desktop');
+ const resident = await retryConnect(paths, CURRENT_PROTOCOL);
assert.equal(resident.kind, 'connected');
if (resident.kind !== 'connected') return;
@@ -1012,7 +997,6 @@ describe('non-serving Runtime Host kernel', () => {
encodeLegacyProtocolFrame({
kind: 'hello',
clientInstanceId: 'stale-schema-resident',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: 20,
@@ -1036,7 +1020,6 @@ describe('non-serving Runtime Host kernel', () => {
const blocked = await connectOrSpawnRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'tui',
protocol: LEGACY_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -1054,7 +1037,6 @@ describe('non-serving Runtime Host kernel', () => {
encodeLegacyProtocolFrame({
kind: 'hello',
clientInstanceId: 'stale-schema-idle',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
}),
@@ -1071,13 +1053,11 @@ describe('non-serving Runtime Host kernel', () => {
connectRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'tui',
protocol: LEGACY_PROTOCOL,
}),
connectRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'run',
protocol: LEGACY_PROTOCOL,
}),
]);
@@ -1109,8 +1089,8 @@ describe('non-serving Runtime Host kernel', () => {
test('two independent Clients with different cache environments attach to one cold-start Host', async () => {
await withHostPaths(async (paths) => {
- const first = spawnConnectClient(paths, 'desktop', 'a');
- const second = spawnConnectClient(paths, 'tui', 'b');
+ const first = spawnConnectClient(paths, 'a');
+ const second = spawnConnectClient(paths, 'b');
const [firstConnected, secondConnected] = await Promise.all([
waitForConnectedClient(first),
waitForConnectedClient(second),
@@ -1172,7 +1152,6 @@ describe('non-serving Runtime Host kernel', () => {
const stillConnected = await connectRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'run',
protocol: CURRENT_PROTOCOL,
});
assert.equal(stillConnected.kind, 'connected');
@@ -1196,7 +1175,6 @@ describe('non-serving Runtime Host kernel', () => {
const staleDiscovery = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'inspect',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -1216,7 +1194,6 @@ describe('non-serving Runtime Host kernel', () => {
const successor = await connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'inspect',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -1430,7 +1407,7 @@ describe('non-serving Runtime Host kernel', () => {
const probeWindowCrossed = new Promise<void>((resolve) => {
markProbesCrossed = resolve;
});
- const connected = await retryConnect(paths, CURRENT_PROTOCOL, 'tui', {
+ const connected = await retryConnect(paths, CURRENT_PROTOCOL, {
livenessIntervalMs,
onLivenessProbe: () => {
livenessProbes += 1;
@@ -1587,7 +1564,6 @@ describe('non-serving Runtime Host kernel', () => {
assert.ok(owner);
const result = await connectOrSpawnRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -1683,7 +1659,6 @@ describe('non-serving Runtime Host kernel', () => {
connectOrSpawnRuntimeHostWithDependencies(
{
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -1726,7 +1701,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: 'draining-client',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -1759,7 +1733,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: 'epoch-mismatch-client',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH + 1,
@@ -1786,6 +1759,50 @@ describe('non-serving Runtime Host kernel', () => {
});
});
+ test('accepts Client hellos with and without the legacy surface identity', async () => {
+ await withHostPaths(async (paths) => {
+ const candidate = await startTestRuntimeHostCandidate(paths, {
+ rootPath: paths.root,
+ idleGraceMs: 10_000,
+ });
+ assert.equal(candidate.kind, 'winner');
+ if (candidate.kind !== 'winner') return;
+
+ try {
+ for (const hello of [
+ {
+ kind: 'hello',
+ clientInstanceId: 'client-without-surface',
+ protocolMin: CURRENT_PROTOCOL.min,
+ protocolMax: CURRENT_PROTOCOL.max,
+ compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
+ compositionId: 'maka.interactive',
+ },
+ {
+ kind: 'hello',
+ clientInstanceId: 'legacy-client-with-surface',
+ surface: 'tui',
+ protocolMin: CURRENT_PROTOCOL.min,
+ protocolMax: CURRENT_PROTOCOL.max,
+ compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
+ compositionId: 'maka.interactive',
+ },
+ ]) {
+ const transport = new FramedTransport(await openSocket(candidate.host.endpoint));
+ try {
+ await writeRawLocalIpc(transport, encodeLegacyProtocolFrame(hello));
+ const response = decodeHostFrame(await transport.read(2_000));
+ assert.ok('kind' in response && response.kind === 'accepted');
+ } finally {
+ transport.abort();
+ }
+ }
+ } finally {
+ await candidate.host.close();
+ }
+ });
+ });
+
test('releases composition connection resources after admitted requests settle', async () => {
await withHostPaths(async (paths) => {
const capability = await resolveStorageRoot({ path: paths.root, kind: 'interactive' });
@@ -1835,7 +1852,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: 'composition-connection-release',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -1909,7 +1925,6 @@ describe('non-serving Runtime Host kernel', () => {
await withTimeout(factoryEntered, 1_000, 'Runtime Host did not enter composition');
const connected = await connectRuntimeHost({
rootPath: paths.root,
- surface: 'desktop',
protocol: CURRENT_PROTOCOL,
});
assert.equal(connected.kind, 'connected');
@@ -1962,7 +1977,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: 'half-open-client',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -2005,7 +2019,6 @@ describe('non-serving Runtime Host kernel', () => {
const observer = await connectRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'inspect',
protocol: CURRENT_PROTOCOL,
});
assert.equal(observer.kind, 'connected');
@@ -2093,7 +2106,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: 'bounded-shutdown-test',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -2137,7 +2149,6 @@ describe('non-serving Runtime Host kernel', () => {
await writeClientFrame(rejectedHandshakeTransport, {
kind: 'hello',
clientInstanceId: 'post-drain-client',
- surface: 'inspect',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -2246,7 +2257,6 @@ describe('non-serving Runtime Host kernel', () => {
() =>
connectRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
connectTimeoutMs: 0,
}),
@@ -2256,7 +2266,6 @@ describe('non-serving Runtime Host kernel', () => {
() =>
connectRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
handshakeTimeoutMs: 0,
}),
@@ -2266,7 +2275,6 @@ describe('non-serving Runtime Host kernel', () => {
() =>
connectRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
clientInstanceId: '',
}),
@@ -2276,7 +2284,6 @@ describe('non-serving Runtime Host kernel', () => {
() =>
connectOrSpawnRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
compositionId: 'Invalid Composition',
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -2295,7 +2302,6 @@ describe('non-serving Runtime Host kernel', () => {
() =>
connectOrSpawnRuntimeHost({
rootPath: paths.root,
- surface: 'tui',
protocol: CURRENT_PROTOCOL,
compositionId: KERNEL_COMPOSITION.descriptor.id,
candidateEntrypoint: KERNEL_CANDIDATE_ENTRYPOINT,
@@ -2365,7 +2371,6 @@ describe('non-serving Runtime Host kernel', () => {
const result = await connectRuntimeHost({
...paths,
rootPath: paths.root,
- surface: 'inspect',
protocol: CURRENT_PROTOCOL,
});
assert.deepEqual(result, { kind: 'unavailable', reason: 'invalid_registration' });
@@ -2527,14 +2532,10 @@ async function withHostPaths(run: (paths: HostPaths) => Promise<void>): Promise<
}
}
-function spawnConnectClient(
- paths: HostPaths,
- surface: 'desktop' | 'tui',
- environmentSuffix: string,
-): ChildProcess {
+function spawnConnectClient(paths: HostPaths, environmentSuffix: string): ChildProcess {
const fakeHome = join(paths.base, `fake-home-${environmentSuffix}`);
return paths.resources.trackChild(
- fork(new URL('./fixtures/connect-client.js', import.meta.url), [paths.root, surface], {
+ fork(new URL('./fixtures/connect-client.js', import.meta.url), [paths.root], {
stdio: ['ignore', 'ignore', 'inherit', 'ipc'],
env: {
...process.env,
@@ -2596,7 +2597,6 @@ function isConnectedClientMessage(
async function retryConnect(
paths: HostPaths,
protocol: { min: number; max: number },
- surface: ClientSurface = 'tui',
options?: { livenessIntervalMs?: number; onLivenessProbe?: () => void },
) {
const deadline = Date.now() + 5_000;
@@ -2604,7 +2604,6 @@ async function retryConnect(
...paths,
...options,
rootPath: paths.root,
- surface,
protocol,
});
while (result.kind !== 'connected' && Date.now() < deadline) {
@@ -2613,7 +2612,6 @@ async function retryConnect(
...paths,
...options,
rootPath: paths.root,
- surface,
protocol,
});
}
@@ -2981,7 +2979,6 @@ async function openNonReadingStatusSocket(path: string): Promise<Socket> {
`${JSON.stringify({
kind: 'hello',
clientInstanceId: 'non-reading-client',
- surface: 'tui',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
diff --git a/packages/runtime-host/src/__tests__/host-profile.test.ts b/packages/runtime-host/src/__tests__/host-profile.test.ts
index af1cf0e55..84fffaa6c 100644
--- a/packages/runtime-host/src/__tests__/host-profile.test.ts
+++ b/packages/runtime-host/src/__tests__/host-profile.test.ts
@@ -366,7 +366,6 @@ describe('Runtime Host profiles', () => {
rootId: ROOT_A,
},
credential: 'opaque-token',
- surface: 'tui',
clientInstanceId: 'client-1',
},
{
@@ -402,7 +401,6 @@ describe('Runtime Host profiles', () => {
rootId: ROOT_A,
},
credential: 'opaque-token',
- surface: 'run',
clientInstanceId: 'client-1',
},
{
@@ -441,7 +439,6 @@ describe('Runtime Host profiles', () => {
rootId: ROOT_A,
},
credential: 'opaque-token',
- surface: 'tui',
clientInstanceId: 'client-1',
sshInteraction: 'inherit',
},
@@ -475,7 +472,6 @@ describe('Runtime Host profiles', () => {
rootId: ROOT_A,
},
credential: 'opaque-token',
- surface: 'run',
clientInstanceId: 'client-1',
},
{
@@ -506,7 +502,6 @@ describe('Runtime Host profiles', () => {
{
profile: remoteProfile('office', endpoint, rootId),
credential,
- surface: 'run',
clientInstanceId: 'client-1',
},
{
@@ -661,7 +656,6 @@ describe('Runtime Host profiles', () => {
{
profile: remoteProfile('office', 'wss://runtime.example.com/', ROOT_A),
credential: 'revoked-token',
- surface: 'run',
clientInstanceId: 'client-1',
},
{ connect: async () => ({ kind: 'unavailable', reason: 'authentication_failed' }) },
@@ -686,7 +680,6 @@ describe('Runtime Host profiles', () => {
{
profile: remoteProfile('office', 'wss://runtime.example.com/', ROOT_A),
credential: 'opaque-token',
- surface: 'run',
clientInstanceId: 'client-1',
},
{ connect: async () => ({ kind: 'unavailable', reason }) },
diff --git a/packages/runtime-host/src/__tests__/hosted-execution-coordinator.test.ts b/packages/runtime-host/src/__tests__/hosted-execution-coordinator.test.ts
index 31d07ce23..f4cb427a5 100644
--- a/packages/runtime-host/src/__tests__/hosted-execution-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/hosted-execution-coordinator.test.ts
@@ -74,7 +74,6 @@ function context() {
return {
hostEpoch: 'host-epoch',
connectionId: 'hosted-execution',
- surface: 'run' as const,
principal: 'runtime_host' as const,
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/hosted-execution-runner.test.ts b/packages/runtime-host/src/__tests__/hosted-execution-runner.test.ts
index aa04a95f8..cdba8118c 100644
--- a/packages/runtime-host/src/__tests__/hosted-execution-runner.test.ts
+++ b/packages/runtime-host/src/__tests__/hosted-execution-runner.test.ts
@@ -317,7 +317,6 @@ function context() {
return {
hostEpoch: 'host-epoch',
connectionId: 'hosted-execution',
- surface: 'run' as const,
principal: 'runtime_host' as const,
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/interaction-coordinator.test.ts b/packages/runtime-host/src/__tests__/interaction-coordinator.test.ts
index d30ba09b8..b5b68c4c3 100644
--- a/packages/runtime-host/src/__tests__/interaction-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/interaction-coordinator.test.ts
@@ -789,7 +789,6 @@ function connection(): ConnectionContext {
return {
hostEpoch: 'host_epoch_1',
connectionId: 'connection_1',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => {} }),
};
diff --git a/packages/runtime-host/src/__tests__/memory-coordinator.test.ts b/packages/runtime-host/src/__tests__/memory-coordinator.test.ts
index d7f5fd9d6..1d7737b14 100644
--- a/packages/runtime-host/src/__tests__/memory-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/memory-coordinator.test.ts
@@ -703,7 +703,6 @@ async function withCoordinator(
const context: ConnectionContext = {
hostEpoch: 'memory-test-epoch',
connectionId: 'connection-1',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/memory-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/memory-two-client-uds.test.ts
index 8bac1024f..7aa3721ba 100644
--- a/packages/runtime-host/src/__tests__/memory-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/memory-two-client-uds.test.ts
@@ -46,8 +46,8 @@ test('two UDS clients share one recoverable Memory authority across Host death',
await assert.rejects(() => stat(residue.transactionPath), { code: 'ENOENT' });
assert.deepEqual(await readFile(residue.pendingPath), residue.targetPending);
- const desktop = await connectClient(root, 'desktop');
- const tui = await connectClient(root, 'tui');
+ const desktop = await connectClient(root);
+ const tui = await connectClient(root);
let incompleteUploadId: string;
try {
const initial = await memoryState(desktop);
@@ -148,7 +148,7 @@ test('two UDS clients share one recoverable Memory authority across Host death',
assert.doesNotMatch(paged.content, /sk-live-secret-token-value/);
assert.ok((await memoryState(tui)).backups.some((backup) => backup.kind === 'save'));
- const abandoned = await connectClient(root, 'run');
+ const abandoned = await connectClient(root);
const capacityBasis = await memoryState(abandoned);
for (let index = 0; index < 8; index += 1) {
const staged = await abandoned.request('memory.mutate', {
@@ -195,7 +195,7 @@ test('two UDS clients share one recoverable Memory authority across Host death',
}
successor = await startHost(root, capability.rootId);
- const observer = await connectClient(root, 'run');
+ const observer = await connectClient(root);
try {
const recovered = await readDocument(observer, 'memory');
assert.ok(recovered.pageCount > 1);
@@ -291,13 +291,9 @@ function documentDecision(snapshot: MemoryDocumentSnapshot) {
};
}
-async function connectClient(
- rootPath: string,
- surface: 'desktop' | 'tui' | 'run',
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: CURRENT_PROTOCOL,
});
assert.equal(result.kind, 'connected');
diff --git a/packages/runtime-host/src/__tests__/message-coordinator.test.ts b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
index 4f1f83777..959d3a4e9 100644
--- a/packages/runtime-host/src/__tests__/message-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/message-coordinator.test.ts
@@ -1829,7 +1829,6 @@ function operationContext(connectionId = 'connection-1') {
return {
hostEpoch: 'epoch-1',
connectionId,
- surface: 'tui' as const,
principal: 'local_os_user' as const,
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/oauth-coordinator.test.ts b/packages/runtime-host/src/__tests__/oauth-coordinator.test.ts
index b7409dc71..b3ec6a3d9 100644
--- a/packages/runtime-host/src/__tests__/oauth-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/oauth-coordinator.test.ts
@@ -978,7 +978,6 @@ function operationContext(connectionId: string, acquireResidency: () => { releas
return {
hostEpoch: 'host-epoch',
connectionId,
- surface: 'desktop' as const,
principal: 'local_os_user' as const,
acquireResidency,
};
diff --git a/packages/runtime-host/src/__tests__/oauth-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/oauth-two-client-uds.test.ts
index 3aa21d05b..afd6b0357 100644
--- a/packages/runtime-host/src/__tests__/oauth-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/oauth-two-client-uds.test.ts
@@ -97,8 +97,8 @@ test('OAuth enrollment presents only on the initiating Client over the real endp
};
}),
});
- first = await connectClient(root, 'desktop');
- second = await connectClient(root, 'tui');
+ first = await connectClient(root);
+ second = await connectClient(root);
const presentations: string[] = [];
await first.replaceClientCapabilities(
createOAuthPresentationClientProvider({
@@ -237,7 +237,7 @@ async function assertProviderDisabledOverUds(
};
}),
});
- client = await connectClient(root, 'desktop');
+ client = await connectClient(root);
let presentations = 0;
await client.replaceClientCapabilities(
createOAuthPresentationClientProvider({
@@ -267,13 +267,9 @@ async function assertProviderDisabledOverUds(
}
}
-async function connectClient(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const connected = await connectRuntimeHost({
rootPath,
- surface,
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/__tests__/operation-dispatcher.test.ts b/packages/runtime-host/src/__tests__/operation-dispatcher.test.ts
index baef7876b..f7b55305d 100644
--- a/packages/runtime-host/src/__tests__/operation-dispatcher.test.ts
+++ b/packages/runtime-host/src/__tests__/operation-dispatcher.test.ts
@@ -13,7 +13,6 @@ import {
const context: ConnectionContext = {
hostEpoch: 'epoch-1',
connectionId: 'connection-1',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/owned-candidate.test.ts b/packages/runtime-host/src/__tests__/owned-candidate.test.ts
index 94e3a6b41..f9486e1b3 100644
--- a/packages/runtime-host/src/__tests__/owned-candidate.test.ts
+++ b/packages/runtime-host/src/__tests__/owned-candidate.test.ts
@@ -16,7 +16,6 @@ test('owned connection keeps a fresh Host alive for its full election window', a
const result = await connectOwnedRuntimeHostWithDependencies(
{
rootPath,
- surface: 'run',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -52,7 +51,6 @@ test('owned Host exits promptly after its first connection closes', async () =>
const result = await connectOwnedRuntimeHostWithDependencies(
{
rootPath,
- surface: 'run',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/__tests__/plan-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/plan-two-client-uds.test.ts
index eb28f54f2..4343a044c 100644
--- a/packages/runtime-host/src/__tests__/plan-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/plan-two-client-uds.test.ts
@@ -65,7 +65,7 @@ test('two Clients and a restarted production Host share one retry-safe Plan auth
composition: defineInteractiveRuntimeHostComposition(deterministicBackendComposition),
});
owner = undefined;
- [desktop, tui] = await Promise.all([connect(root, 'desktop'), connect(root, 'tui')]);
+ [desktop, tui] = await Promise.all([connect(root), connect(root)]);
const subscription = await desktop.openSessionSubscription({
sessionId: session.id,
transcript: { kind: 'none' },
@@ -118,7 +118,7 @@ test('two Clients and a restarted production Host share one retry-safe Plan auth
composition: defineInteractiveRuntimeHostComposition(deterministicBackendComposition),
});
owner = undefined;
- tui = await connect(root, 'tui');
+ tui = await connect(root);
const replayed = await tui.startPlanTurn(approval);
assert.equal(replayed.plan.executionId, approved.executionId);
@@ -176,11 +176,8 @@ test('two Clients and a restarted production Host share one retry-safe Plan auth
}
});
-async function connect(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
- const result = await connectRuntimeHost({ rootPath, surface, protocol: PROTOCOL });
+async function connect(rootPath: string): Promise<RuntimeHostConnection> {
+ const result = await connectRuntimeHost({ rootPath, protocol: PROTOCOL });
assert.equal(result.kind, 'connected');
if (result.kind !== 'connected') throw new Error('Unable to connect to Runtime Host');
return result.connection;
diff --git a/packages/runtime-host/src/__tests__/project-catalog-coordinator.test.ts b/packages/runtime-host/src/__tests__/project-catalog-coordinator.test.ts
index 6ffd3c7fd..eae011e5b 100644
--- a/packages/runtime-host/src/__tests__/project-catalog-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/project-catalog-coordinator.test.ts
@@ -183,7 +183,6 @@ function connection(): ConnectionContext {
return {
hostEpoch: 'host-1',
connectionId: 'desktop',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => {} }),
};
diff --git a/packages/runtime-host/src/__tests__/project-catalog-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/project-catalog-two-client-uds.test.ts
index 306a33130..75ef73ff4 100644
--- a/packages/runtime-host/src/__tests__/project-catalog-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/project-catalog-two-client-uds.test.ts
@@ -16,7 +16,7 @@ import {
readRuntimeHostSessions,
type RuntimeHostConnection,
} from '../client/index.js';
-import { RUNTIME_HOST_PROTOCOL_VERSION, type ClientSurface } from '../protocol/index.js';
+import { RUNTIME_HOST_PROTOCOL_VERSION } from '../protocol/index.js';
import { createExecutionRuntimeHostComposition } from '../server/execution-composition.js';
import { defineInteractiveRuntimeHostComposition } from '../server/host-composition.js';
import { RuntimeHostKernel } from '../server/index.js';
@@ -49,10 +49,7 @@ test('two UDS clients converge on one Host-owned Project Catalog', {
idleGraceMs: 30_000,
composition: defineInteractiveRuntimeHostComposition(createExecutionRuntimeHostComposition),
});
- const [desktop, tui] = await Promise.all([
- connectClient(dataRoot, 'desktop'),
- connectClient(dataRoot, 'tui'),
- ]);
+ const [desktop, tui] = await Promise.all([connectClient(dataRoot), connectClient(dataRoot)]);
connections.push(desktop, tui);
assert.deepEqual(await readRuntimeHostProjects(desktop), await readRuntimeHostProjects(tui));
@@ -154,13 +151,9 @@ function sessionInput(cwd: string, projectId: string) {
};
}
-async function connectClient(
- rootPath: string,
- surface: ClientSurface,
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: PROTOCOL,
connectTimeoutMs: REQUEST_TIMEOUT_MS,
handshakeTimeoutMs: REQUEST_TIMEOUT_MS,
diff --git a/packages/runtime-host/src/__tests__/protocol.test.ts b/packages/runtime-host/src/__tests__/protocol.test.ts
index 55aef9205..a1a7b3810 100644
--- a/packages/runtime-host/src/__tests__/protocol.test.ts
+++ b/packages/runtime-host/src/__tests__/protocol.test.ts
@@ -40,6 +40,34 @@ import {
} from '../protocol/turn.js';
describe('Runtime Host bootstrap protocol', () => {
+ test('decodes a Client hello without a surface identity', () => {
+ const hello = {
+ kind: 'hello',
+ clientInstanceId: 'client-without-surface',
+ protocolMin: RUNTIME_HOST_PROTOCOL_VERSION,
+ protocolMax: RUNTIME_HOST_PROTOCOL_VERSION,
+ compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
+ compositionId: 'maka.interactive',
+ } as const;
+
+ assert.deepEqual(decodeClientFrame(hello), hello);
+ });
+
+ test('ignores a legacy surface identity while decoding a Client hello', () => {
+ const hello = {
+ kind: 'hello',
+ clientInstanceId: 'legacy-surface-client',
+ surface: 'tui',
+ protocolMin: RUNTIME_HOST_PROTOCOL_VERSION,
+ protocolMax: RUNTIME_HOST_PROTOCOL_VERSION,
+ compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
+ compositionId: 'maka.interactive',
+ } as const;
+
+ const { surface: _legacySurface, ...expected } = hello;
+ assert.deepEqual(decodeClientFrame(hello), expected);
+ });
+
test('publishes a new compatibility epoch for Session catalog live-run state', () => {
// Epoch 22 predates the live-run projection and rejects its added catalog
// field, so mixed-version peers must fail during the handshake instead.
diff --git a/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts b/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts
index 91c707937..bcd4e0d9d 100644
--- a/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/root-turn-coordinator.test.ts
@@ -4917,7 +4917,6 @@ function operationContext(
return {
hostEpoch,
connectionId,
- surface: 'tui' as const,
principal: 'local_os_user' as const,
acquireResidency,
};
diff --git a/packages/runtime-host/src/__tests__/runtime-policy-coordinator.test.ts b/packages/runtime-host/src/__tests__/runtime-policy-coordinator.test.ts
index 3f67ec5cb..1699b2279 100644
--- a/packages/runtime-host/src/__tests__/runtime-policy-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/runtime-policy-coordinator.test.ts
@@ -29,7 +29,6 @@ import { HostRuntimePolicyCoordinator } from '../server/runtime-policy-coordinat
const context: ConnectionContext = {
hostEpoch: 'runtime-policy-test-epoch',
connectionId: 'runtime-policy-test-connection',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/runtime-resource-coordinator.test.ts b/packages/runtime-host/src/__tests__/runtime-resource-coordinator.test.ts
index d8debe424..cea8652db 100644
--- a/packages/runtime-host/src/__tests__/runtime-resource-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/runtime-resource-coordinator.test.ts
@@ -694,7 +694,6 @@ function connection(connectionId: string): ConnectionContext {
return {
hostEpoch: 'host-1',
connectionId,
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => {} }),
};
diff --git a/packages/runtime-host/src/__tests__/runtime-resource-process.test.ts b/packages/runtime-host/src/__tests__/runtime-resource-process.test.ts
index 4b452d619..d9593f18d 100644
--- a/packages/runtime-host/src/__tests__/runtime-resource-process.test.ts
+++ b/packages/runtime-host/src/__tests__/runtime-resource-process.test.ts
@@ -285,7 +285,6 @@ function connection(connectionId: string): ConnectionContext {
return {
hostEpoch: 'host-1',
connectionId,
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => {} }),
};
diff --git a/packages/runtime-host/src/__tests__/runtime-resource-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/runtime-resource-two-client-uds.test.ts
index 113e65367..0278029c2 100644
--- a/packages/runtime-host/src/__tests__/runtime-resource-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/runtime-resource-two-client-uds.test.ts
@@ -103,7 +103,7 @@ test('a Host-owned PTY survives Desktop disconnect and transfers control to TUI'
});
assert.equal(started.status, 'running');
- [desktop, tui] = await Promise.all([connect(root, 'desktop'), connect(root, 'tui')]);
+ [desktop, tui] = await Promise.all([connect(root), connect(root)]);
const desktopList = await desktop.request('runtime.resource.query', {
kind: 'list_start',
sessionId: SESSION_ID,
@@ -177,11 +177,8 @@ test('a Host-owned PTY survives Desktop disconnect and transfers control to TUI'
}
});
-async function connect(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
- const result = await connectRuntimeHost({ rootPath, surface, protocol: PROTOCOL });
+async function connect(rootPath: string): Promise<RuntimeHostConnection> {
+ const result = await connectRuntimeHost({ rootPath, protocol: PROTOCOL });
assert.equal(result.kind, 'connected');
if (result.kind !== 'connected') throw new Error('Runtime Host Client did not connect');
return result.connection;
diff --git a/packages/runtime-host/src/__tests__/session-catalog-coordinator.test.ts b/packages/runtime-host/src/__tests__/session-catalog-coordinator.test.ts
index e0dd53286..35b01897a 100644
--- a/packages/runtime-host/src/__tests__/session-catalog-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/session-catalog-coordinator.test.ts
@@ -41,7 +41,6 @@ type SessionContinuity = HostSessionCatalogCoordinatorOptions['continuity'];
const context: ConnectionContext = {
hostEpoch: 'session-catalog-test-epoch',
connectionId: 'session-catalog-test-client',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/session-catalog-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/session-catalog-two-client-uds.test.ts
index 12dd3d53b..c16f9e059 100644
--- a/packages/runtime-host/src/__tests__/session-catalog-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/session-catalog-two-client-uds.test.ts
@@ -68,8 +68,8 @@ test('two Clients share stable Session creation, CAS configuration, and catalog
let host: ExecutionHostHandle | undefined;
try {
host = await startHost(root, capability.rootId);
- const desktop = await connectClient(root, 'desktop');
- const tui = await connectClient(root, 'tui');
+ const desktop = await connectClient(root);
+ const tui = await connectClient(root);
try {
const catalogChanged = new Promise<string>((resolve) => {
tui.subscribeSessionCatalogChanges(({ sessionId }) => resolve(sessionId));
@@ -664,7 +664,7 @@ test('stable Session creation survives response loss and Host restart', {
modelTarget: { kind: 'default' },
};
dropped = await sendCreateWithoutReadingResponse(host.endpoint, input);
- const observer = await connectClient(root, 'tui');
+ const observer = await connectClient(root);
const committed = await waitForSession(observer, input.sessionId);
dropped.abort();
dropped = undefined;
@@ -672,7 +672,7 @@ test('stable Session creation survives response loss and Host restart', {
await terminateHost(host);
host = await startHost(root, capability.rootId);
- const retrying = await connectClient(root, 'desktop');
+ const retrying = await connectClient(root);
try {
const retried = requireSessionProjection(await retrying.request('session.create', input));
const { liveRunState, ...persistedCommitted } = committed;
@@ -1009,13 +1009,9 @@ async function terminateChild(child: ChildProcess): Promise<void> {
);
}
-async function connectClient(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: CURRENT_PROTOCOL,
});
assert.equal(result.kind, 'connected');
@@ -1031,7 +1027,6 @@ async function sendCreateWithoutReadingResponse(
await writeClientFrame(transport, {
kind: 'hello',
clientInstanceId: randomUUID(),
- surface: 'desktop',
protocolMin: CURRENT_PROTOCOL.min,
protocolMax: CURRENT_PROTOCOL.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
diff --git a/packages/runtime-host/src/__tests__/session-continuity-coordinator.test.ts b/packages/runtime-host/src/__tests__/session-continuity-coordinator.test.ts
index 0730b43a3..56e960cf8 100644
--- a/packages/runtime-host/src/__tests__/session-continuity-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/session-continuity-coordinator.test.ts
@@ -1777,7 +1777,6 @@ function connectionContext(connectionId: string): ConnectionContext {
return {
hostEpoch: HOST_EPOCH,
connectionId,
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/session-effect-coordinator.test.ts b/packages/runtime-host/src/__tests__/session-effect-coordinator.test.ts
index 78eb1764e..72b6f3e86 100644
--- a/packages/runtime-host/src/__tests__/session-effect-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/session-effect-coordinator.test.ts
@@ -15,7 +15,6 @@ import type { HostSessionEffectModel } from '../server/execution-model-authority
const connectionContext: ConnectionContext = {
hostEpoch: 'host-epoch-1',
connectionId: 'connection-1',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release: () => undefined }),
};
diff --git a/packages/runtime-host/src/__tests__/session-effect-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/session-effect-two-client-uds.test.ts
index 6a71af9d6..764280910 100644
--- a/packages/runtime-host/src/__tests__/session-effect-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/session-effect-two-client-uds.test.ts
@@ -78,8 +78,8 @@ test('two Clients share one durable Session recap effect', async () => {
let desktop: RuntimeHostConnection | undefined;
let tui: RuntimeHostConnection | undefined;
try {
- desktop = await connect(root, 'desktop');
- tui = await connect(root, 'tui');
+ desktop = await connect(root);
+ tui = await connect(root);
const input = { sessionId: 'session-1', effectId: 'effect-1', reason: 'manual' as const };
const desktopResult = desktop.generateSessionRecap(input);
await modelStarted.promise;
@@ -110,11 +110,8 @@ function gate(): { promise: Promise<void>; release(): void } {
return { promise, release };
}
-async function connect(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
- const result = await connectRuntimeHost({ rootPath, surface, protocol: PROTOCOL });
+async function connect(rootPath: string): Promise<RuntimeHostConnection> {
+ const result = await connectRuntimeHost({ rootPath, protocol: PROTOCOL });
assert.equal(result.kind, 'connected');
if (result.kind !== 'connected') throw new Error('Unable to connect to Runtime Host');
return result.connection;
diff --git a/packages/runtime-host/src/__tests__/session-retirement-coordinator.test.ts b/packages/runtime-host/src/__tests__/session-retirement-coordinator.test.ts
index 08ded21cf..48bdb4a41 100644
--- a/packages/runtime-host/src/__tests__/session-retirement-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/session-retirement-coordinator.test.ts
@@ -21,7 +21,6 @@ import { HostSessionRetirementCoordinator } from '../server/session-retirement-c
const CONNECTION_CONTEXT: ConnectionContext = {
hostEpoch: 'retirement-test',
connectionId: 'retirement-test-connection',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/session-revision-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/session-revision-two-client-uds.test.ts
index 7fcc8ee97..71d54e171 100644
--- a/packages/runtime-host/src/__tests__/session-revision-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/session-revision-two-client-uds.test.ts
@@ -121,8 +121,8 @@ async function verifyConcurrentRevisionAuthority(
graphChildSessionId: string,
continuationSourceSessionId: string,
): Promise<void> {
- const desktop = await connectClient(root, 'desktop');
- const tui = await connectClient(root, 'tui');
+ const desktop = await connectClient(root);
+ const tui = await connectClient(root);
try {
const source = await querySession(desktop, sourceSessionId);
const continuationSource = await querySession(desktop, continuationSourceSessionId);
@@ -399,7 +399,7 @@ async function verifyRestartRecoveryAndAdmission(
root: string,
sourceSessionId: string,
): Promise<void> {
- const restarted = await connectClient(root, 'desktop');
+ const restarted = await connectClient(root);
try {
assert.deepEqual(
await restarted.request('session.catalog.query', {
@@ -485,7 +485,7 @@ async function verifyRestartRecoveryAndAdmission(
}
async function verifySecondRestartRetention(root: string, sourceSessionId: string): Promise<void> {
- const recovered = await connectClient(root, 'desktop');
+ const recovered = await connectClient(root);
try {
assert.deepEqual(
await recovered.request('session.catalog.query', {
@@ -1500,13 +1500,9 @@ async function terminateChild(child: ChildProcess): Promise<void> {
);
}
-async function connectClient(
- rootPath: string,
- surface: 'desktop' | 'tui',
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: CURRENT_PROTOCOL,
});
assert.equal(result.kind, 'connected');
diff --git a/packages/runtime-host/src/__tests__/session-subscription-client.test.ts b/packages/runtime-host/src/__tests__/session-subscription-client.test.ts
index 5d9ed1820..2f6f8304b 100644
--- a/packages/runtime-host/src/__tests__/session-subscription-client.test.ts
+++ b/packages/runtime-host/src/__tests__/session-subscription-client.test.ts
@@ -1120,7 +1120,6 @@ async function withProtocolPeer(
});
const connected = await connectRuntimeHost({
rootPath: join(base, 'root'),
- surface: 'tui',
protocol: PROTOCOL,
});
assert.equal(connected.kind, 'connected');
diff --git a/packages/runtime-host/src/__tests__/skill-catalog-coordinator.test.ts b/packages/runtime-host/src/__tests__/skill-catalog-coordinator.test.ts
index 333037363..982b2e6c0 100644
--- a/packages/runtime-host/src/__tests__/skill-catalog-coordinator.test.ts
+++ b/packages/runtime-host/src/__tests__/skill-catalog-coordinator.test.ts
@@ -238,7 +238,6 @@ test('invocable pages use the authoritative Host tool surface and invalidate on
const context: ConnectionContext = {
hostEpoch: 'epoch-1',
connectionId: 'desktop-1',
- surface: 'desktop',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/skill-catalog-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/skill-catalog-two-client-uds.test.ts
index b84782c97..d578ab0a8 100644
--- a/packages/runtime-host/src/__tests__/skill-catalog-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/skill-catalog-two-client-uds.test.ts
@@ -11,11 +11,7 @@ import {
tryAcquireInteractiveRootOwner,
} from '@maka/storage/root-authority';
import { connectRuntimeHost, type RuntimeHostConnection } from '../client/index.js';
-import {
- RUNTIME_HOST_PROTOCOL_VERSION,
- type ClientSurface,
- type SkillCatalogQueryResult,
-} from '../protocol/index.js';
+import { RUNTIME_HOST_PROTOCOL_VERSION, type SkillCatalogQueryResult } from '../protocol/index.js';
import { createExecutionRuntimeHostComposition } from '../server/execution-composition.js';
import { RuntimeHostKernel } from '../server/index.js';
@@ -74,10 +70,7 @@ Keep ${privateMarker} inside the lazy-loaded body.
});
endpoint = host.endpoint;
- const [desktop, tui] = await Promise.all([
- connectClient(dataRoot, 'desktop'),
- connectClient(dataRoot, 'tui'),
- ]);
+ const [desktop, tui] = await Promise.all([connectClient(dataRoot), connectClient(dataRoot)]);
connections.push(desktop, tui);
const query = {
@@ -205,13 +198,9 @@ Keep ${privateMarker} inside the lazy-loaded body.
}
});
-async function connectClient(
- rootPath: string,
- surface: ClientSurface,
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: PROTOCOL,
connectTimeoutMs: REQUEST_TIMEOUT_MS,
handshakeTimeoutMs: REQUEST_TIMEOUT_MS,
diff --git a/packages/runtime-host/src/__tests__/usage-pricing-client-correlation.test.ts b/packages/runtime-host/src/__tests__/usage-pricing-client-correlation.test.ts
index 44537e006..f32afa2b6 100644
--- a/packages/runtime-host/src/__tests__/usage-pricing-client-correlation.test.ts
+++ b/packages/runtime-host/src/__tests__/usage-pricing-client-correlation.test.ts
@@ -295,7 +295,6 @@ async function withProtocolPeer(
});
const connected = await connectRuntimeHost({
rootPath: root,
- surface: 'tui',
protocol: PROTOCOL,
});
assert.equal(connected.kind, 'connected');
diff --git a/packages/runtime-host/src/__tests__/usage-pricing-protocol.test.ts b/packages/runtime-host/src/__tests__/usage-pricing-protocol.test.ts
index 72e7abd74..5a58488a1 100644
--- a/packages/runtime-host/src/__tests__/usage-pricing-protocol.test.ts
+++ b/packages/runtime-host/src/__tests__/usage-pricing-protocol.test.ts
@@ -38,7 +38,6 @@ import { RuntimePolicyActivationGate } from '../server/runtime-policy-activation
const CONNECTION_CONTEXT: ConnectionContext = {
hostEpoch: 'usage-pricing-protocol-test',
connectionId: 'usage-pricing-protocol-test-connection',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/usage-pricing-root-identity.test.ts b/packages/runtime-host/src/__tests__/usage-pricing-root-identity.test.ts
index 19d864039..668604a4c 100644
--- a/packages/runtime-host/src/__tests__/usage-pricing-root-identity.test.ts
+++ b/packages/runtime-host/src/__tests__/usage-pricing-root-identity.test.ts
@@ -17,7 +17,6 @@ import { HostUsagePricingCoordinator } from '../server/usage-pricing-coordinator
const CONNECTION_CONTEXT: ConnectionContext = {
hostEpoch: 'root-identity-test',
connectionId: 'root-identity-test-connection',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
diff --git a/packages/runtime-host/src/__tests__/usage-pricing-two-client-uds.test.ts b/packages/runtime-host/src/__tests__/usage-pricing-two-client-uds.test.ts
index ce7b8561e..5ec37a599 100644
--- a/packages/runtime-host/src/__tests__/usage-pricing-two-client-uds.test.ts
+++ b/packages/runtime-host/src/__tests__/usage-pricing-two-client-uds.test.ts
@@ -22,7 +22,6 @@ import {
import { connectRuntimeHost, type RuntimeHostConnection } from '../client/index.js';
import {
RUNTIME_HOST_PROTOCOL_VERSION,
- type ClientSurface,
type EffectivePricingEntry,
type PricingQueryResult,
} from '../protocol/index.js';
@@ -40,7 +39,6 @@ const REQUEST_TIMEOUT_MS = 5_000;
const CONNECTION_CONTEXT: ConnectionContext = {
hostEpoch: 'usage-pricing-test',
connectionId: 'usage-pricing-test-connection',
- surface: 'tui',
principal: 'local_os_user',
acquireResidency: () => ({ release() {} }),
};
@@ -451,10 +449,7 @@ describe('production Usage/Pricing UDS', () => {
preHostUsageStores = undefined;
endpoint = host.endpoint;
- const [desktop, tui] = await Promise.all([
- connectClient(root, 'desktop'),
- connectClient(root, 'tui'),
- ]);
+ const [desktop, tui] = await Promise.all([connectClient(root), connectClient(root)]);
clients.push(desktop, tui);
const [desktopUsage, tuiUsage] = await Promise.all([readUsage(desktop), readUsage(tui)]);
assert.deepEqual(tuiUsage, desktopUsage);
@@ -644,8 +639,8 @@ describe('production Usage/Pricing UDS', () => {
});
successorOwner = undefined;
const [desktopAfterRestart, tuiAfterRestart] = await Promise.all([
- connectClient(root, 'desktop'),
- connectClient(root, 'tui'),
+ connectClient(root),
+ connectClient(root),
]);
clients.push(desktopAfterRestart, tuiAfterRestart);
const [usageAfterRestart, pricingAfterRestart, pricingFromSecondClient] = await Promise.all([
@@ -694,13 +689,9 @@ describe('production Usage/Pricing UDS', () => {
});
});
-async function connectClient(
- rootPath: string,
- surface: ClientSurface,
-): Promise<RuntimeHostConnection> {
+async function connectClient(rootPath: string): Promise<RuntimeHostConnection> {
const result = await connectRuntimeHost({
rootPath,
- surface,
protocol: PROTOCOL,
connectTimeoutMs: REQUEST_TIMEOUT_MS,
handshakeTimeoutMs: REQUEST_TIMEOUT_MS,
diff --git a/packages/runtime-host/src/client/connect-or-spawn.ts b/packages/runtime-host/src/client/connect-or-spawn.ts
index 10ab806aa..7fb939ea7 100644
--- a/packages/runtime-host/src/client/connect-or-spawn.ts
+++ b/packages/runtime-host/src/client/connect-or-spawn.ts
@@ -9,7 +9,6 @@ import {
requireClientInstanceId,
requireHostCompositionId,
validateProtocolRange,
- type ClientSurface,
type HostIncompatible,
type ProtocolRange,
} from '../protocol/index.js';
@@ -42,7 +41,6 @@ const MIN_CANDIDATE_INTERVAL_MS = 250;
export interface ConnectOrSpawnRuntimeHostInput {
rootPath: string;
- surface: ClientSurface;
protocol: ProtocolRange;
compositionId: string;
generation?: string;
@@ -195,7 +193,6 @@ export async function connectOrSpawnRuntimeHostWithDependencies(
const result = await connectResolvedRuntimeHost({
capability,
controlDirectory,
- surface: input.surface,
protocol: input.protocol,
compositionId: input.compositionId,
...(input.generation === undefined ? {} : { generation: input.generation }),
diff --git a/packages/runtime-host/src/client/connection.ts b/packages/runtime-host/src/client/connection.ts
index 8a03d06cc..4e4ab01f0 100644
--- a/packages/runtime-host/src/client/connection.ts
+++ b/packages/runtime-host/src/client/connection.ts
@@ -19,7 +19,7 @@ import {
type ClientCapabilityHostFrame,
type ClientCapabilityReplaceResult,
type ClientCapabilityUnregisterResult,
- type ClientSurface,
+ type ClientHello,
type ConfigurationChangedFrame,
type ContextCompactInput,
type ContextCompactResult,
@@ -99,7 +99,6 @@ const MAX_WEBSOCKET_BUFFERED_CHUNKS = 256;
export interface ConnectRuntimeHostInput {
rootPath: string;
- surface: ClientSurface;
protocol: ProtocolRange;
compositionId?: string;
generation?: string;
@@ -168,7 +167,6 @@ export interface ConnectRemoteRuntimeHostInput {
readonly credential: string;
readonly expectedRootId: string;
readonly compositionId: string;
- readonly surface: ClientSurface;
readonly protocol: ProtocolRange;
readonly clientInstanceId?: string;
readonly connectTimeoutMs?: number;
@@ -1125,7 +1123,6 @@ export async function connectRemoteRuntimeHost(
try {
const result = await exchangeRuntimeHostHandshake({
transport,
- surface: input.surface,
protocol: input.protocol,
clientInstanceId: normalized.clientInstanceId,
compositionId,
@@ -1296,7 +1293,6 @@ export async function connectResolvedRuntimeHost(
: input.protocol;
const result = await exchangeRuntimeHostHandshake({
transport,
- surface: input.surface,
protocol: input.protocol,
helloProtocol,
clientInstanceId: input.clientInstanceId,
@@ -1375,7 +1371,6 @@ export async function connectResolvedRuntimeHost(
interface ExchangeRuntimeHostHandshakeInput {
readonly transport: RuntimeHostMessageTransport;
- readonly surface: ClientSurface;
readonly protocol: ProtocolRange;
readonly helloProtocol?: ProtocolRange;
readonly hostProtocol?: ProtocolRange;
@@ -1391,6 +1386,17 @@ interface ExchangeRuntimeHostHandshakeInput {
readonly connectionResource?: RuntimeHostConnectionResource;
}
+interface LegacySurfaceClientHello extends ClientHello {
+ /**
+ * Hosts from compatibility epoch 27 may require this field while decoding
+ * the bootstrap hello. Keep the sentinel private until the minimum supported
+ * compatibility epoch is greater than 27; the removal change must bump the
+ * epoch so old Hosts take the structured incompatibility path. Tracked by
+ * #3297. This is not part of the Client identity seen by new Hosts.
+ */
+ readonly surface: 'desktop';
+}
+
async function exchangeRuntimeHostHandshake(
input: ExchangeRuntimeHostHandshakeInput,
): Promise<
@@ -1399,10 +1405,10 @@ async function exchangeRuntimeHostHandshake(
| { kind: 'draining' }
> {
const helloProtocol = input.helloProtocol ?? input.protocol;
- await writeClientFrame(input.transport, {
+ const hello: LegacySurfaceClientHello = {
kind: 'hello',
clientInstanceId: input.clientInstanceId,
- surface: input.surface,
+ surface: 'desktop',
protocolMin: helloProtocol.min,
protocolMax: helloProtocol.max,
compatibilityEpoch: RUNTIME_HOST_COMPATIBILITY_EPOCH,
@@ -1411,7 +1417,8 @@ async function exchangeRuntimeHostHandshake(
...(input.takeoverHostEpoch === undefined
? {}
: { takeover: { expectedHostEpoch: input.takeoverHostEpoch } }),
- });
+ };
+ await writeClientFrame(input.transport, hello);
const handshake = decodeHostFrame(await input.transport.read(0));
if (!('kind' in handshake)) {
throw new Error('Runtime Host returned an operation response before handshake');
diff --git a/packages/runtime-host/src/client/host-profile.ts b/packages/runtime-host/src/client/host-profile.ts
index 3bcdce906..f0d14d365 100644
--- a/packages/runtime-host/src/client/host-profile.ts
+++ b/packages/runtime-host/src/client/host-profile.ts
@@ -8,7 +8,6 @@ import {
isCanonicalRuntimeHostWebSocketPath,
RUNTIME_HOST_PROTOCOL_VERSION,
requireHostRootId,
- type ClientSurface,
} from '../protocol/index.js';
import {
connectRemoteRuntimeHost,
@@ -155,7 +154,6 @@ export async function connectRemoteRuntimeHostProfile(
input: {
readonly profile: RemoteRuntimeHostProfile;
readonly credential: string;
- readonly surface: ClientSurface;
readonly clientInstanceId: string;
readonly signal?: AbortSignal;
readonly connectTimeoutMs?: number;
@@ -189,7 +187,6 @@ export async function connectRemoteRuntimeHostProfile(
credential: input.credential,
expectedRootId: input.profile.rootId,
compositionId: INTERACTIVE_RUNTIME_HOST_COMPOSITION_ID,
- surface: input.surface,
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/client/hosted-execution.ts b/packages/runtime-host/src/client/hosted-execution.ts
index f93a785d5..1f4b30639 100644
--- a/packages/runtime-host/src/client/hosted-execution.ts
+++ b/packages/runtime-host/src/client/hosted-execution.ts
@@ -38,7 +38,6 @@ export async function runHostedExecutionWithDependencies(
}
const initial = await dependencies.connectOwnedRuntimeHost({
rootPath: input.rootPath,
- surface: 'run',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
@@ -79,7 +78,6 @@ export async function runHostedExecutionWithDependencies(
}
const reconnected = await dependencies.connectOwnedRuntimeHost({
rootPath: input.rootPath,
- surface: 'run',
protocol: {
min: RUNTIME_HOST_PROTOCOL_VERSION,
max: RUNTIME_HOST_PROTOCOL_VERSION,
diff --git a/packages/runtime-host/src/protocol/index.ts b/packages/runtime-host/src/protocol/index.ts
index 98c130abd..54bc6f661 100644
--- a/packages/runtime-host/src/protocol/index.ts
+++ b/packages/runtime-host/src/protocol/index.ts
@@ -88,15 +88,6 @@ export type EncodedProtocolMessage = Buffer & {
readonly [encodedProtocolMessageBrand]: true;
};
-export type ClientSurface =
- | 'desktop'
- | 'tui'
- | 'run'
- | 'activation'
- | 'bot'
- | 'inspect'
- | 'capability-provider';
-
export interface ProtocolRange {
min: number;
max: number;
@@ -105,7 +96,6 @@ export interface ProtocolRange {
export interface ClientHello {
kind: 'hello';
clientInstanceId: string;
- surface: ClientSurface;
protocolMin: number;
protocolMax: number;
compatibilityEpoch: number;
@@ -219,7 +209,6 @@ export function decodeClientFrame(value: unknown): ClientFrame {
return {
kind: 'hello',
clientInstanceId: requireClientInstanceId(frame.clientInstanceId),
- surface: requireSurface(frame.surface),
protocolMin,
protocolMax,
compatibilityEpoch: decodeCompatibilityEpoch(frame.compatibilityEpoch),
@@ -402,20 +391,6 @@ function decodeCompatibilityEpoch(value: unknown): number {
return value === undefined ? 0 : requireCompatibilityEpoch(value);
}
-function requireSurface(value: unknown): ClientSurface {
- if (
- value === 'desktop' ||
- value === 'tui' ||
- value === 'run' ||
- value === 'activation' ||
- value === 'bot' ||
- value === 'inspect' ||
- value === 'capability-provider'
- )
- return value;
- throw invalidProtocolFrame('Invalid surface');
-}
-
function requireAcceptedState(value: unknown): Exclude<HostLifecycleState, 'draining'> {
const state = requireHostLifecycleState(value);
if (state === 'draining') throw invalidProtocolFrame('Accepted Host cannot be draining');
diff --git a/packages/runtime-host/src/server/execution-composition.ts b/packages/runtime-host/src/server/execution-composition.ts
index bfd5ca9c5..b51a9366a 100644
--- a/packages/runtime-host/src/server/execution-composition.ts
+++ b/packages/runtime-host/src/server/execution-composition.ts
@@ -1313,7 +1313,6 @@ export async function createExecutionRuntimeHostComposition(
context: {
hostEpoch: context.hostEpoch,
connectionId: 'hosted-execution',
- surface: 'run',
principal: 'runtime_host',
acquireResidency: () => context.acquireResidency('hosted-execution'),
},
diff --git a/packages/runtime-host/src/server/host-kernel.ts b/packages/runtime-host/src/server/host-kernel.ts
index eb5832bd7..ccaf41f74 100644
--- a/packages/runtime-host/src/server/host-kernel.ts
+++ b/packages/runtime-host/src/server/host-kernel.ts
@@ -364,7 +364,6 @@ export class RuntimeHostKernel {
hostEpoch: this.hostEpoch,
connectionId: result.connectionId,
clientInstanceId: frame.clientInstanceId,
- surface: frame.surface,
authority,
},
resolveHandlers: () => this.#operationHandlers,
diff --git a/packages/runtime-host/src/server/operation-dispatcher.ts b/packages/runtime-host/src/server/operation-dispatcher.ts
index 4da7c1cc1..81d8464af 100644
--- a/packages/runtime-host/src/server/operation-dispatcher.ts
+++ b/packages/runtime-host/src/server/operation-dispatcher.ts
@@ -1,6 +1,5 @@
import {
HOST_OPERATION_SPECS,
- type ClientSurface,
decodeOperationOutcome,
type HostOperationErrorCode,
type OperationInput,
@@ -17,7 +16,6 @@ import { ACCESS_AUTHORITY_OPERATION_SPECS } from '../protocol/access-authority.j
export interface ConnectionContext {
hostEpoch: string;
connectionId: string;
- surface: ClientSurface;
principal: string;
acquireResidency(): OperationResidency;
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org