stablyai/orca · warning · Error
Branch status unavailable
Error message
Branch status unavailable
What it means
Thrown in the fallback branch of `readUpstreamStatusForSync`. When `git.upstreamStatus` fails with a mobile-git-unavailable code, the code degrades to `git.status` and reads `status.upstreamStatus`. If that field is absent (the branch has no upstream tracking configured), the sync cannot compute ahead/behind and this error is thrown. Non-git-unavailable failures re-throw the original error instead.
Source
Thrown at mobile/src/source-control/use-mobile-git-requests.ts:63
throw new Error(result?.error || 'Commit failed')
}
return result
},
[sendGitRequest]
)
const readUpstreamStatusForSync = useCallback(async (): Promise<MobileGitUpstreamStatus> => {
try {
return await sendGitRequest<MobileGitUpstreamStatus>('git.upstreamStatus')
} catch (err) {
const code = err instanceof Error ? (err as GitRequestError).code : undefined
const message = err instanceof Error ? err.message : String(err)
if (!isMobileGitUnavailable(code, message)) {
throw err
}
const status = await sendGitRequest<MobileGitStatusResult>('git.status')
if (!status.upstreamStatus) {
throw new Error('Branch status unavailable')
}
return status.upstreamStatus
}
}, [sendGitRequest])
const runGitSyncSteps = useCallback(async () => {
await sendGitRequest<unknown>('git.fetch')
await sendGitRequest<unknown>('git.pull')
const nextUpstream = await readUpstreamStatusForSync()
if (nextUpstream.ahead > 0) {
await sendGitRequest<unknown>('git.push')
}
}, [readUpstreamStatusForSync, sendGitRequest])
return { sendGitRequest, sendCommitRequest, runGitSyncSteps }
}
View on GitHub (pinned to 1136503c6a)
Solutions
- Push the branch with upstream tracking first (`git push -u origin <branch>`).
- Update the desktop host so `git.upstreamStatus` is supported natively.
- If the branch is intentionally local, skip sync until an upstream is configured.
Defensive patterns
Strategy: fallback
Validate before calling
// Check upstream tracking before offering Sync.
if (!status.branch?.upstream) {
setSyncUnavailable('Set an upstream branch before syncing.')
} Try / catch
// readUpstreamStatusForSync already degrades git.upstreamStatus → git.status;
// treat 'Branch status unavailable' as 'no upstream' and skip push.
try {
const upstream = await readUpstreamStatusForSync()
} catch (err) {
if (err instanceof Error && err.message === 'Branch status unavailable') {
// skip push; the branch is local-only
} else throw err
} Prevention
- Push new branches with `-u` so upstream tracking exists before Sync.
- Update the host to support `git.upstreamStatus` natively to avoid the fallback path.
- Hide Sync for branches with no upstream.
When it happens
Trigger: Running `runGitSyncSteps` where `git.upstreamStatus` is unavailable on the host AND the fallback `git.status` returns a result with `upstreamStatus` missing/null — i.e. the current branch has no upstream (local-only branch, never pushed with `-u`).
Common situations: User creates a local branch and tries to Sync before setting an upstream; the upstream remote was deleted; HEAD is detached; the host build is old (no `git.upstreamStatus`) and the branch is untracked.
Related errors
- Source control action failed
- Unable to resolve branch base
- Failed to load commit history
- ${created.current.error}
- Commit failed
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/26d8bae7e6363d7e.
Report an issue: GitHub.