stablyai/orca · error · Error

Failed to create terminal

Error message

Failed to create terminal

What it means

Thrown when `session.tabs.createTerminal` (for the notes-send path) returns ok:false. The host's error.message is preferred; the literal is the fallback.

Source

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

      setActionError('Review notes sent')
      setSendSheet(null)
    },
    [client, connState, markNotesSent, setActionError, setSendSheet]
  )

  const createTerminalAndSend = useCallback(
    async (comments: readonly DiffComment[]) => {
      if (!client || connState !== 'connected') {
        throw new Error('Waiting for desktop...')
      }
      const response = await client.sendRequest('session.tabs.createTerminal', {
        worktree: `id:${worktreeId}`,
        activate: false,
        select: true,
        navigation: 'caller'
      })
      if (!response.ok) {
        throw new Error(response.error?.message || 'Failed to create terminal')
      }
      const created = readMobileReviewCreatedTerminal(response.result)
      if (!created) {
        throw new Error('Created terminal response was invalid')
      }
      await sendPromptToTerminal(created.terminal, comments)
    },
    [client, connState, sendPromptToTerminal, worktreeId]
  )

  const openSendSheet = useCallback(async () => {
    if (!client || connState !== 'connected') {
      setActionError('Waiting for desktop...')
      return
    }
    setSendSheet({ kind: 'loading' })
    try {
      const response = await client.sendRequest('session.tabs.list', {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Retry after reconnecting.
  2. Verify the worktree exists.
  3. Check host terminal quota.
  4. Update versions.

Example fix

// before
if (!response.ok) {
  throw new Error(response.error?.message || 'Failed to create terminal')
}
// after
if (!response.ok) {
  throw new RpcMethodError('session.tabs.createTerminal', response.error)
}
Defensive patterns

Strategy: try-catch

Validate before calling

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

Type guard

function isRpcFailure(r: RpcResponse): r is RpcFailure {
  return r.ok === false
}

Try / catch

try {
  await createTerminalAndSend(comments)
} catch (err) {
  setActionError(err instanceof Error ? err.message : 'Failed to create terminal')
}

Prevention

When it happens

Trigger: Host refuses terminal creation - worktree gone, quota, or a transport failure on the one-shot.

Common situations: Worktree deleted mid-review; terminal limit; relay cutover; version skew.

Related errors


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