stablyai/orca · warning · Error
Waiting for desktop...
Error message
Waiting for desktop...
What it means
Guard inside `sendGitRequest`, the shared transport used by every mobile source-control git RPC. If `client` is null or `connState` is anything other than `'connected'`, the request never leaves the device and this error is thrown synchronously. It signals 'not ready yet' rather than a real failure — the desktop pairing/relay is still handshaking or has dropped.
Source
Thrown at mobile/src/source-control/use-mobile-git-requests.ts:23
isMobileGitUnavailable,
type MobileGitStatusResult,
type MobileGitUpstreamStatus
} from './mobile-git-status'
import type { GitCommitResult, GitRequestError } from './mobile-source-control-screen-state'
type Params = {
client: RpcClient | null
connState: ConnectionState
worktreeId: string
}
// The raw RPC layer for source-control git actions. Pure transport — owns no
// screen state, so it stays out of the giant state hook.
export function useMobileGitRequests({ client, connState, worktreeId }: Params) {
const sendGitRequest = useCallback(
async <T>(method: string, params?: Record<string, unknown>): Promise<T> => {
if (!client || connState !== 'connected') {
throw new Error('Waiting for desktop...')
}
const response = await client.sendRequest(method, {
worktree: `id:${worktreeId}`,
...params
})
if (!response.ok) {
const error = new Error(
response.error?.message || 'Source control action failed'
) as GitRequestError
error.code = response.error?.code
throw error
}
return (response as RpcSuccess).result as T
},
[client, connState, worktreeId]
)
const sendCommitRequest = useCallback(View on GitHub (pinned to 1136503c6a)
Solutions
- Gate source-control actions behind the `connected` state in the UI (disable buttons until connected).
- Retry the action once `connState` reports `connected`.
- If it persists, check the connection log for an `auth-failed` or `reconnecting` loop and re-pair.
Example fix
// before — calling git actions regardless of connection
await sendGitRequest('git.commit', { message })
// after — guard the call site
if (connState !== 'connected' || !client) return
await sendGitRequest('git.commit', { message }) Defensive patterns
Strategy: validation
Validate before calling
// Guard at the call site before any git RPC.
function canSendGitRequest(client: RpcClient | null, connState: ConnectionState): boolean {
return client !== null && connState === 'connected'
}
if (!canSendGitRequest(client, connState)) {
setActionError('Waiting for desktop...')
return
} Try / catch
// Treat 'Waiting for desktop...' as a transient, retryable condition — not a hard error.
try {
await sendGitRequest('git.status')
} catch (err) {
if (err instanceof Error && err.message === 'Waiting for desktop...') {
// wait for connection, then retry
} else throw err
} Prevention
- Disable source-control actions in the UI until connState === 'connected'.
- Never assume the client is non-null after a host switch — re-check.
- Distinguish this transient guard from real RPC failures in the UI.
When it happens
Trigger: Any code path that calls `sendGitRequest` (commit, fetch, pull, push, status, upstreamStatus, rebaseFromBase) while `connState` is `connecting|handshaking|disconnected|reconnecting|auth-failed`, or before the `client` reference is bound.
Common situations: User taps a source-control action immediately on screen open before the relay finishes handshaking; the connection dropped and a stale callback fires; switching hosts leaves a transient window where `client` is null.
Related errors
- Waiting for desktop...
- Waiting for desktop...
- Waiting for desktop...
- [plain-node-entry-guard] guarded ${missing.map((name) => `"$
- ${commandLabel} ${args.join(' ')} failed to start: ${String(
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/573577868c889e6b.
Report an issue: GitHub.