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.
This commit is contained in:
Neil
2026-09-01 12:50:57 -07:00
parent 8f1c98ff6c
commit 8360c068ab
2 changed files with 5 additions and 5 deletions
@@ -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
@@ -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<CreateRun>(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)
})
})