stablyai/orca · error · Error

Commit failed

Error message

Commit failed

What it means

Thrown by `sendCommitRequest` after the `git.commit` RPC returns ok:true but the application-level result is not a success — either the result is nullish or `result.success !== true`. The host signals a logical commit failure (as opposed to a transport failure) and optionally provides `result.error`; this code surfaces that detail or the literal 'Commit failed'.

Source

Thrown at mobile/src/source-control/use-mobile-git-requests.ts:45

        ...params
      })
      if (!response.ok) {
        const error = new Error(
          response.error?.message || 'Source control action failed'
        ) as GitRequestError
        error.code = response.error?.code
        throw error
      }
      return (response as RpcSuccess).result as T
    },
    [client, connState, worktreeId]
  )

  const sendCommitRequest = useCallback(
    async (message: string): Promise<GitCommitResult> => {
      const result = await sendGitRequest<GitCommitResult>('git.commit', { message })
      if (!result || result.success !== true) {
        throw new Error(result?.error || 'Commit failed')
      }
      return result
    },
    [sendGitRequest]
  )

  const readUpstreamStatusForSync = useCallback(async (): Promise<MobileGitUpstreamStatus> => {
    try {
      return await sendGitRequest<MobileGitUpstreamStatus>('git.upstreamStatus')
    } catch (err) {
      const code = err instanceof Error ? (err as GitRequestError).code : undefined
      const message = err instanceof Error ? err.message : String(err)
      if (!isMobileGitUnavailable(code, message)) {
        throw err
      }
      const status = await sendGitRequest<MobileGitStatusResult>('git.status')
      if (!status.upstreamStatus) {
        throw new Error('Branch status unavailable')

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Inspect `result.error` (surfaced as the message) for the exact host reason.
  2. Stage at least one change before committing.
  3. Resolve a failing pre-commit hook or bypass it if intentional.
  4. Remove a stale `.git/index.lock` if no git process is running.
Defensive patterns

Strategy: validation

Validate before calling

// Validate commit preconditions before sending.
if (countStagedEntries(entries) === 0) {
  setActionError('Nothing staged to commit.')
  return
}

Type guard

function isCommitSuccess(result: unknown): result is GitCommitResult {
  return !!result && (result as GitCommitResult).success === true
}

Try / catch

try {
  const result = await sendCommitRequest(message)
} catch (err) {
  // result.success === false carries a host reason; surface it, don't retry blindly
  setActionError(err instanceof Error ? err.message : 'Commit failed')
}

Prevention

When it happens

Trigger: Calling `sendCommitRequest(message)` where `git.commit` resolves with `{ success: false, error }` or an empty result. Typical host-side reasons: nothing staged to commit, a pre-commit hook exited non-zero, a lock file (.git/index.lock) is held, or the commit was rejected by a server-side rule.

Common situations: User taps Commit with nothing staged; a husky/pre-commit hook fails; another git process holds the index lock; commit-message validation rejects the input.

Related errors


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