stablyai/orca · warning · Error

Waiting for desktop...

Error message

Waiting for desktop...

What it means

Guard thrown by `sendPromptToTerminal` (send review notes to an existing terminal) when client is null or connState !== 'connected'. It blocks the terminal.send of formatted review notes.

Source

Thrown at mobile/src/session/use-mobile-diff-review-send-actions.ts:76

  const markNotesSent = useCallback(
    async (comments: readonly DiffComment[]) => {
      if (screenState.kind !== 'ready') {
        return
      }
      const next = markMobileDiffCommentsSent(
        screenState.comments,
        new Set(comments.map((comment) => comment.id)),
        Date.now()
      )
      await saveCommentsAndReviewState(next, screenState.reviewState)
    },
    [saveCommentsAndReviewState, screenState]
  )

  const sendPromptToTerminal = useCallback(
    async (terminal: string, comments: readonly DiffComment[]) => {
      if (!client || connState !== 'connected') {
        throw new Error('Waiting for desktop...')
      }
      // Marked by terminal handle, not by surface, so a paste orphaned here by native
      // chat would ride along with these notes (#10228). Diff review carries no device token.
      if (!(await healMobileNativeChatStaleInput({ client, terminal, deviceToken: null }))) {
        throw new Error('Failed to send notes')
      }
      const response = await client.sendRequest('terminal.send', {
        terminal,
        text: formatMobileDiffReviewPrompt(comments),
        enter: true
      })
      if (!response.ok) {
        throw new Error(response.error?.message || 'Failed to send notes')
      }
      if (!readMobileReviewTerminalSendAccepted(response.result)) {
        throw new Error('Terminal input is locked')
      }
      await markNotesSent(comments)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Wait for 'connected'.
  2. Re-open the send sheet after reconnect.
  3. Re-pair if auth-failed.

Example fix

// before
if (!client || connState !== 'connected') {
  throw new Error('Waiting for desktop...')
}
// after - surface as sheet error instead of throwing
if (!client || connState !== 'connected') {
  setActionError('Waiting for desktop...')
  return
}
Defensive patterns

Strategy: validation

Validate before calling

if (!client || connState !== 'connected') {
  setActionError('Waiting for desktop...')
  return
}

Try / catch

try {
  await sendPromptToTerminal(terminal, comments)
} catch (err) {
  if ((err as Error).message !== 'Waiting for desktop...') throw err
  setActionError('Reconnecting...')
}

Prevention

When it happens

Trigger: Sending notes during a non-connected transport state. Triggered from the send-sheet's 'send to existing terminal' action while connecting/handshaking/reconnecting/auth-failed/disconnected.

Common situations: Relay drop while the send sheet is open; selecting a terminal just as the connection drops; reconnect window.

Related errors


AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12). Data as JSON: /api/errors/218ae21821b2eb1c. Report an issue: GitHub.