stablyai/orca · warning · Error

Waiting for desktop...

Error message

Waiting for desktop...

What it means

Thrown in persistDiffComments() when attempting to save review notes (diff comments) but the client is not connected (client is null or connState !== 'connected'). Diff comments are persisted via the worktree.set RPC, which requires an active connection to the desktop host. This guards against losing edits during a disconnect.

Source

Thrown at mobile/app/h/[hostId]/session/[worktreeId].tsx:1946

      setDiffComments([])
      return
    }
    const response = await client.sendRequest('worktree.show', {
      worktree: `id:${worktreeId}`
    })
    if (!response.ok) {
      return
    }
    const result = (response as RpcSuccess).result as {
      worktree?: { diffComments?: unknown }
    }
    setDiffComments(normalizeMobileDiffComments(result.worktree?.diffComments, worktreeId))
  }, [client, connState, worktreeId, isFloatingWorkspaceRoute])

  const persistDiffComments = useCallback(
    async (comments: readonly DiffComment[]): Promise<void> => {
      if (!client || connState !== 'connected') {
        throw new Error('Waiting for desktop...')
      }
      const response = await client.sendRequest('worktree.set', {
        worktree: `id:${worktreeId}`,
        diffComments: comments
      })
      if (!response.ok) {
        throw new Error((response as RpcFailure).error.message || 'Failed to save review notes')
      }
    },
    [client, connState, worktreeId]
  )

  useEffect(() => {
    void loadDiffComments()
  }, [loadDiffComments])

  const addDiffCommentForFile = useCallback(
    async (filePath: string, lineNumber: number, body: string): Promise<boolean> => {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Wait for connState to return to 'connected' before retrying the save.
  2. Queue the comments locally and retry persistDiffComments on reconnection.
  3. Check connState in the UI to disable the save action or show a 'reconnecting' indicator.
  4. If the disconnect persists, verify the remote host is reachable and the session is still active.

Example fix

// before: throws immediately on disconnect
if (!client || connState !== 'connected') {
  throw new Error('Waiting for desktop...')
}

// after: queue and retry on reconnect
if (!client || connState !== 'connected') {
  pendingDiffCommentsRef.current = comments
  return
}
// On reconnect, flush pendingDiffCommentsRef.current
Defensive patterns

Strategy: retry

Validate before calling

function assertConnected(client, connState) {
  if (!client || connState !== 'connected') {
    throw new Error('Waiting for desktop...')
  }
}

Type guard

function isClientReady(client, connState) {
  return client !== null && client !== undefined && connState === 'connected'
}

Try / catch

try {
  await persistDiffComments(comments)
} catch (err) {
  if (err.message === 'Waiting for desktop...') {
    // Queue locally and retry when connState returns to 'connected'
    pendingCommentsRef.current = comments
  } else {
    throw err
  }
}

Prevention

When it happens

Trigger: persistDiffComments(comments) is called when connState is 'connecting', 'disconnected', 'error', or client is null. Caused by: the user editing review notes while the connection drops; a reconnect in progress; the session loading before the client initializes; a transient network interruption.

Common situations: User on mobile editing review notes when the SSH/remote connection to the desktop host drops; switching networks causing a brief disconnect; the desktop process restarting; connState transitioning during a save attempt.

Related errors


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