stablyai/orca · error · Error
Failed to send notes
Error message
Failed to send notes
What it means
Thrown in the terminal.send promise chain when sending notes/prompt to a newly created terminal fails at the RPC level (ok: false) and the failure has no error.message. This is the fallback string when the server-side rejection lacks a descriptive message. The terminal was created successfully but sending the prompt text to it was rejected.
Source
Thrown at mobile/app/h/[hostId]/session/[worktreeId].tsx:3725
const next = [...prev, createdTerminal]
terminalsRef.current = next
return next
})
subscribeToTerminal(createdHandle)
if (options?.initialPrompt?.trim()) {
void client
.sendRequest(
'terminal.send',
buildTerminalSendParams({
terminal: createdHandle,
text: options.initialPrompt,
enter: options.enter !== false,
deviceToken: deviceTokenRef.current
})
)
.then((sendResponse) => {
if (!sendResponse.ok) {
throw new Error(
(sendResponse as RpcFailure).error.message || 'Failed to send notes'
)
}
const result = (sendResponse as RpcSuccess).result as {
send?: { accepted?: boolean }
}
if (result.send?.accepted === false) {
throw new Error('Terminal input is locked by another client.')
}
triggerSuccess()
showToast(options.successToast ?? 'Notes sent')
options.onPromptSent?.()
})
.catch((err) => {
triggerError()
showToast(
options.errorToast ??
(err instanceof Error ? err.message : "Couldn't send notes"),View on GitHub (pinned to 1136503c6a)
Solutions
- Check the desktop host logs for the terminal.send rejection reason.
- Verify the deviceToken is current and matches the session's token.
- If the terminal exited between create and send, consider retrying the send or recreating the terminal.
- Log the full failure object (code, details) when error.message is empty.
Example fix
// before: empty message gives generic 'Failed to send notes'
throw new Error(
(sendResponse as RpcFailure).error.message || 'Failed to send notes'
)
// after: include error code
const failure = sendResponse as RpcFailure
throw new Error(
failure.error.message ||
`Failed to send notes (code: ${failure.error.code ?? 'unknown'})`
) Defensive patterns
Strategy: try-catch
Validate before calling
function buildSendErrorMessage(sendResponse) {
if (sendResponse.ok) return null
const failure = sendResponse as RpcFailure
return failure.error.message || `Failed to send notes (code: ${failure.error.code ?? 'unknown'})`
} Type guard
function isTerminalSendAccepted(response) {
if (!response.ok) return false
const result = (response as RpcSuccess).result as { send?: { accepted?: boolean } }
return result?.send?.accepted !== false
} Try / catch
// Already handled via .catch in the source — extend it:
.catch((err) => {
triggerError()
if (err.message === 'Failed to send notes') {
// RPC failed with no message — check host logs
showToast('Send failed — the desktop host rejected the request', 1800)
} else {
showToast(err.message, 1800)
}
}) Prevention
- Verify the deviceToken is current before sending to a newly created terminal.
- Include the RPC error code in the fallback message.
- Ensure the desktop host returns descriptive error messages for terminal.send rejections.
When it happens
Trigger: client.sendRequest('terminal.send', {...}) returns ok:false with error.message empty/undefined. Caused by: the terminal handle becoming invalid between create and send; the device token being rejected; a server-side validation failure with no message; the terminal process exiting before the send.
Common situations: A quick command or prompt send to a terminal that exited immediately after creation; a device token mismatch between mobile and desktop; a version skew in the terminal.send params schema; the terminal being locked or disposed server-side.
Related errors
- Failed to save review notes
- Failed to create markdown note
- Failed to create terminal
- Created terminal response was invalid
- Failed to create terminal
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/cf1aff724fb234df.
Report an issue: GitHub.