From 8360c068abb07767195607fcd75387cfe2d5d6fa Mon Sep 17 00:00:00 2001 From: Neil <4138956+nwparker@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:50:57 -0700 Subject: [PATCH] fix(runtime): scope both reconcile call sites to the owning host uniformly Both create-dedupe and fenced-spawn reclaim now pass the workspace's own connection (null for local/folder), so neither falls back to the aggregate listing that silently drops a non-answering SSH provider. --- .../runtime/orca-runtime-terminal-create-deduplication.ts | 2 +- .../orca-runtime-terminal-create-idempotency.test.ts | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/main/runtime/orca-runtime-terminal-create-deduplication.ts b/src/main/runtime/orca-runtime-terminal-create-deduplication.ts index dab41a53ced..a1743a855ce 100644 --- a/src/main/runtime/orca-runtime-terminal-create-deduplication.ts +++ b/src/main/runtime/orca-runtime-terminal-create-deduplication.ts @@ -46,7 +46,7 @@ export class OrcaRuntimeWithTerminalCreateDeduplication extends OrcaRuntimeWithC // Why: an unreachable SSH host vanishes from the aggregate listing, which would read // as absence and respawn over live remote work. Local/folder workspaces have no // connection and keep the aggregate listing. - workspace.connectionId ?? undefined + workspace.connectionId ?? null ) if (adopted) { return adopted diff --git a/src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts b/src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts index d1552250a18..f8f8600dc1f 100644 --- a/src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts +++ b/src/main/runtime/orca-runtime-terminal-create-idempotency.test.ts @@ -346,7 +346,7 @@ describe('terminal create reconciliation scopes inventory to the owning executio expect(listProcesses).toHaveBeenCalledWith('ssh-1') }) - it('keeps the aggregate listing for a local workspace with no connection', async () => { + it('scopes the listing to the local host for a workspace with no connection', async () => { const handle = deriveRemoteRuntimeTerminalCreateHandle('device-a', 'worktree-1', 'mutation-1') const listProcesses = createHostScopedInventory({ local: [{ ...remoteSession(handle), cwd: '/local/workspace', title: 'pwsh' }] @@ -357,11 +357,11 @@ describe('terminal create reconciliation scopes inventory to the owning executio await expect( runtime.dedupeTerminalCreate('device-a', 'id:worktree-1', 'mutation-1', true, create) ).resolves.toMatchObject({ handle, ptyId: 'worktree-1@@session-a' }) - expect(listProcesses).toHaveBeenCalledWith(undefined) + expect(listProcesses).toHaveBeenCalledWith(null) expect(create).not.toHaveBeenCalled() }) - it('keeps the aggregate listing for a folder workspace with no connection', async () => { + it('scopes the listing to the local host for a folder workspace with no connection', async () => { const listProcesses = createHostScopedInventory({}) const { runtime } = createRuntimeForDedupe(listProcesses, { connectionId: null }) const create = vi.fn(async (_selector, handle) => @@ -377,6 +377,6 @@ describe('terminal create reconciliation scopes inventory to the owning executio ) expect(create).toHaveBeenCalledWith('id:folder:folder-1', result.handle) - expect(listProcesses).toHaveBeenCalledWith(undefined) + expect(listProcesses).toHaveBeenCalledWith(null) }) })