{"record":{"id":"cce3d6ac1014a763","repo":"stablyai/orca","slug":"created-current-error","errorCode":null,"errorMessage":"${created.current.error}","messagePattern":"\\$\\{created\\.current\\.error\\}","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"mobile/src/source-control/use-mobile-create-pr-runner.ts","lineNumber":84,"sourceCode":"        return\n      }\n      const created: { current: MobileHostedReviewCreateIntentRunOutcome | null } = {\n        current: null\n      }\n      let progress: MobileHostedReviewCreateIntentProgress | null = null\n      const ran = await runGitWorkflow(pushFirst ? 'push-create-pr' : 'create-pr', async () => {\n        created.current = await runMobileHostedReviewCreateIntent(client, worktreeId, {\n          branch,\n          title: branchLabel,\n          status,\n          commitMessage,\n          onProgress: (nextProgress: MobileHostedReviewCreateIntentProgress) => {\n            progress = nextProgress\n            setActionError(mobileHostedReviewCreateIntentProgressMessage(nextProgress))\n          }\n        })\n        if (!created.current.ok) {\n          throw new Error(created.current.error)\n        }\n      })\n      const outcome = created.current\n      if (outcome?.committed && mountedRef.current) {\n        setCommitMessage('')\n      }\n      if (!ran && outcome?.status !== undefined && mountedRef.current) {\n        await loadStatus({\n          preserveReadyOnFailure: true,\n          clearActionErrorOnSuccess: false,\n          force: true\n        })\n      }\n      if (!ran || !mountedRef.current || !outcome || !outcome.ok) {\n        if (!ran && outcome && isMobileHostedReviewCommitFailure(outcome, progress)) {\n          const outcomeStagedEntries = getMobileCommitFailureStagedEntries(outcome.status?.entries)\n          recordCommitFailure({\n            error: outcome.error,","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/stablyai/orca/blob/1136503c6a231a16dce8f921f6fadb63d181e8db/mobile/src/source-control/use-mobile-create-pr-runner.ts#L66-L102","documentation":"Thrown inside the `runGitWorkflow` runner for create-PR. `runMobileHostedReviewCreateIntent` returns an outcome discriminated by `ok`; when `ok: false` its `error` string is re-thrown so the workflow records the failure. The message is dynamic — it is whatever the hosted-review intent produced (blocked preflight, commit failure, push failure, or PR-create API error), surfaced via `setActionError` on progress callbacks too.","triggerScenarios":"Invoking the create-PR runner (`pushFirst` true or false) where `runMobileHostedReviewCreateIntent` returns `{ ok: false, error }`. Concrete causes: commit preflight blocked the PR (nothing staged / unresolved conflicts), `git.push` failed (no upstream, rejected non-fast-forward), or the hosted-review create RPC returned an error from the provider (GitHub/GitLab quota, auth, branch protection).","commonSituations":"Trying to create a PR with no staged changes; branch has no upstream tracking; force-push blocked by branch protection; provider token expired or lacks scope; network blip during the multi-step commit→push→create flow.","solutions":["Read the surfaced `error` string — it names the exact failed step (commit/push/create).","Ensure there are staged changes and no unresolved conflicts before creating the PR.","Push the branch first and confirm an upstream is configured (`git push -u origin <branch>`).","Re-authenticate the hosted-review provider token if the error cites permission/quota."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":"// Narrow the outcome before throwing so the runner can branch on commit vs PR failure.\nfunction isFailedIntent(o: MobileHostedReviewCreateIntentRunOutcome): o is Extract<MobileHostedReviewCreateIntentRunOutcome, { ok: false }> {\n  return !o.ok\n}","tryCatchPattern":"// runGitWorkflow already wraps this; let the throw propagate but branch on outcome.\nconst ran = await runGitWorkflow('create-pr', async () => {\n  created.current = await runMobileHostedReviewCreateIntent(client, worktreeId, input)\n  if (!created.current.ok) throw new Error(created.current.error)\n})\nif (!ran && created.current && isMobileHostedReviewCommitFailure(created.current, progress)) {\n  recordCommitFailure({ ... }) // recover the commit snapshot\n}","preventionTips":["Stage changes and confirm an upstream before invoking create-PR.","Capture the progress state so commit vs push vs create failures can be distinguished.","Refresh provider tokens before the flow to avoid mid-flow auth errors."],"tags":["source-control","pr","hosted-review","rpc","git"],"backgroundTag":null,"analyzedSha":"1136503c6a231a16dce8f921f6fadb63d181e8db","analyzedAt":"2026-08-12T23:15:58.167Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}