{"record":{"id":"0487c9c4b15094ff","repo":"stablyai/orca","slug":"failed-to-send-prompt","errorCode":null,"errorMessage":"Failed to send prompt","messagePattern":"Failed to send prompt","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/session/pr-ai-triage-launch.ts","lineNumber":37,"sourceCode":"    worktree: `id:${worktreeId}`,\n    activate: false,\n    select: true,\n    navigation: 'caller'\n  })\n  if (!created.ok) {\n    throw new Error(created.error?.message || 'Failed to create terminal')\n  }\n  const terminalTab = readMobileReviewCreatedTerminal(created.result)\n  if (!terminalTab) {\n    throw new Error('Created terminal response was invalid')\n  }\n  const sent = await client.sendRequest('terminal.send', {\n    terminal: terminalTab.terminal,\n    text: prompt,\n    enter: true\n  })\n  if (!sent.ok) {\n    throw new Error(sent.error?.message || 'Failed to send prompt')\n  }\n  if (!readMobileReviewTerminalSendAccepted(sent.result)) {\n    throw new Error('Terminal input is locked')\n  }\n}\n","sourceCodeStart":19,"sourceCodeEnd":43,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/session/pr-ai-triage-launch.ts#L19-L43","documentation":"Thrown when `terminal.send` (the prompt text, enter:true) returns a failure during PR AI triage launch - step two after the terminal was created. The host's error.message is preferred; the literal is the fallback.","triggerScenarios":"Terminal handle became invalid between create and send (closed/disposed), host PTY error, or a transport failure on the one-shot. The prompt is plain text so content-based rejection is unlikely.","commonSituations":"Terminal closed on the host between the two RPCs; relay hiccup; host PTY spawn failure; a host-side permission prompt blocking the send.","solutions":["Retry the whole launch (create + send) after reconnecting.","Check the terminal still exists.","Inspect host PTY logs.","Ensure no host-side input lock is active."],"exampleFix":"// before\nif (!sent.ok) {\n  throw new Error(sent.error?.message || 'Failed to send prompt')\n}\n// after\nif (!sent.ok) {\n  throw new RpcMethodError('terminal.send', sent.error)\n}","handlingStrategy":"try-catch","validationCode":null,"typeGuard":"function isRpcFailure(r: RpcResponse): r is RpcFailure {\n  return r.ok === false\n}","tryCatchPattern":"try {\n  await createTerminalAndSendPrompt(client, worktreeId, prompt)\n} catch (err) {\n  setTriageError(err instanceof Error ? err.message : 'Could not deliver the AI prompt')\n}","preventionTips":["Re-verify the terminal handle immediately before send.","Retry create+send as a unit on transient failures.","Surface host error.message verbatim for diagnosability."],"tags":["rpc","terminal-send","pr-triage","mobile"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}