refactor(providers): an ssh: route carries no provider and throws one typed error (#27477)

Co-authored-by: m4air <m4air@Mac.localdomain>
This commit is contained in:
OrcaWin
2026-10-11 06:25:41 -07:00
committed by GitHub
co-authored by m4air
parent e9279b613e
commit ec14775f93
50 changed files with 285 additions and 1633 deletions
@@ -9,7 +9,7 @@ import {
resolveGitRouteForHost
} from '../providers/execution-host-provider-dispatch'
import type { createLocalGitProvider, LocalGitProvider } from '../providers/local-git-provider'
import { sshGitProviderMissingError } from '../providers/ssh-git-dispatch'
import { getSshGitProvider, sshGitProviderMissingError } from '../providers/ssh-git-dispatch'
import type { SshGitProvider } from '../providers/ssh-git-provider'
import type { CommitMessageAgentEnvironmentResolvers } from '../text-generation/commit-message-agent-environment'
import type { PullRequestLinkedIssueMeta } from '../source-control/pull-request-linked-issue'
@@ -71,7 +71,11 @@ export function runtimeGitRouteForTarget(target: RuntimeGitTarget): RuntimeGitRo
case 'local':
return { kind: 'local', createProvider: route.createProvider }
case 'ssh':
return { kind: 'ssh', connectionId: route.connectionId, provider: route.provider }
return {
kind: 'ssh',
connectionId: route.connectionId,
provider: getSshGitProvider(route.connectionId) ?? null
}
case 'runtime':
throw new ExecutionHostNotDispatchableError(route.hostId)
}