stablyai/orca · error
SSH Git provider is not available. Reconnect to this target
Error message
SSH Git provider is not available. Reconnect to this target and try again.
What it means
Thrown by fetchPrHeadTrackingRef when repo.connectionId is set (SSH/relay target) but the sshGitProvider argument is null or undefined. The relay's read-only git.exec channel rejects `fetch`, so SSH repos must use the dedicated git.fetchRemoteTrackingRef RPC exposed by the provider. A missing provider means the connection's git provider was not wired (or was lost) when the call was made.
Source
Thrown at src/main/github/pr-head-tracking-ref.ts:34
// Why: the relay's read-only git.exec channel rejects `fetch`, so SSH repos
// must use the dedicated git.fetchRemoteTrackingRef RPC.
export async function fetchPrHeadTrackingRef(
repo: { path: string; connectionId?: string | null },
sshGitProvider: SshGitProvider | null | undefined,
remote: string,
branch: string,
options: { localGitExecOptions?: LocalGitExecOptions } = {}
): Promise<void> {
const ref = `refs/remotes/${remote}/${branch}`
if (!repo.connectionId) {
await gitExecFileAsync(
['fetch', remote, `+refs/heads/${branch}:${ref}`],
options.localGitExecOptions ?? { cwd: repo.path }
)
return
}
if (!sshGitProvider) {
throw new Error('SSH Git provider is not available. Reconnect to this target and try again.')
}
await sshGitProvider.fetchRemoteTrackingRef(repo.path, remote, branch, ref)
}
export async function fetchGitHubPullRequestHeadRef(
repo: { path: string; connectionId?: string | null },
sshGitProvider: SshGitProvider | null | undefined,
remote: string,
prNumber: number,
options: { localGitExecOptions?: LocalGitExecOptions } = {}
): Promise<string> {
if (!isValidReviewHeadNumber(prNumber)) {
throw new Error(`Invalid pull request number: ${String(prNumber)}`)
}
if (!isSafeReviewHeadFetchRemote(remote)) {
throw new Error('Pull request fetch remote must not start with "-".')
}
if (!repo.connectionId) {View on GitHub (pinned to 1136503c6a)
Solutions
- Reconnect to the SSH target — this re-registers the git provider.
- Retry the PR-head tracking refresh after reconnect succeeds.
- If it persists, verify the relay process is healthy and the connection shows as active in the UI.
Defensive patterns
Strategy: validation
Validate before calling
function assertSshProviderReady(connectionId: string | null | undefined, provider: unknown) {
if (connectionId && !provider) {
throw new Error('SSH Git provider is not available. Reconnect to this target and try again.')
}
} Type guard
function hasSshGitProvider(p: unknown): p is { fetchRemoteTrackingRef: Function } {
return !!p && typeof (p as any).fetchRemoteTrackingRef === 'function'
} Try / catch
try {
await fetchPrHeadTrackingRef(repo, sshGitProvider, remote, branch)
} catch (err) {
if (/SSH Git provider is not available/.test((err as Error).message)) {
promptReconnect(target)
return
}
throw err
} Prevention
- Ensure the SSH connection is fully established before triggering PR-head refreshes.
- Do not call this function during reconnect; wait for the connection-ready signal.
- Treat provider-unavailable as transient — reconnect and retry, do not show a permanent failure.
When it happens
Trigger: Calling fetchPrHeadTrackingRef during early connection setup before the provider registered; the SSH connection dropped and the provider was torn down while a refresh was in flight; a code path that forgot to inject the provider; reconnect in progress.
Common situations: Refresh firing mid-reconnect; relay restart dropping the provider handle; provider registration race during target switch.
Related errors
- SSH Git provider is not available. Reconnect to this target
- SSH connection "${args.connectionId}" not found or not conne
- SSH target "${input.target.connectionId}" is not connected.
- SSH target did not connect: ${state.status}
- SSH relay providers were not ready for target "${targetId}".
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/e72063722b18f9c7.
Report an issue: GitHub.