stablyai/orca · error · Error

Repo not found: ${args.repoId}

Error message

Repo not found: ${args.repoId}

What it means

Thrown at the top of the worktrees:create IPC handler after store.getRepo(args.repoId) returns undefined. The repository must be registered in the store before any worktree can be created from it. The repoId is the sole correlator used here (deliberately, to avoid leaking branch/remote content).

Source

Thrown at src/main/ipc/worktrees.ts:2194

        return
      }
      try {
        await prefetchWorktreeCreateBase({ repo, baseBranch: args.baseBranch, runtime })
      } catch {
        // Why: optimistic warm-up; the real create path awaits the same refresh and reports failures there.
      }
    }
  )

  ipcMain.handle(
    'worktrees:create',
    async (_event, rawArgs: CreateWorktreeArgs): Promise<CreateWorktreeResult> => {
      const args = normalizeLinkedWorkItemFields(rawArgs)
      // Why span here: parent the child git spans for the trace tree; don't attach branch name/remote URL (user content) — repo ID is the safer correlator.
      return withWorktreeSpan({ stage: 'create' }, async () => {
        const repo = store.getRepo(args.repoId)
        if (!repo) {
          throw new Error(`Repo not found: ${args.repoId}`)
        }

        const sourceParse = workspaceSourceSchema.safeParse(args.telemetrySource)
        const source: WorkspaceSource = sourceParse.success ? sourceParse.data : 'unknown'

        const automationProvenance = resolveAutomationWorkspaceProvenance({
          authority: runtime,
          repoSelector: args.repoId,
          repo,
          request: args.automationProvenanceRequest
        })
        const createArgs: CreateWorktreeArgsWithSystemProvenance = {
          ...args,
          automationProvenance
        }

        let result: CreateWorktreeResult
        try {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Refresh the renderer's repo list and confirm the repoId still exists before offering create.
  2. If automating, query the current repos first and use a live repoId.
  3. Guard the create call by checking store/repos state in the renderer and disabling the action when the repo is gone.
Defensive patterns

Strategy: validation

Validate before calling

const repos = await invoke('repos:list')
if (!repos.some((r) => r.id === repoId)) {
  throw new Error(`Cannot create worktree: repo ${repoId} is not registered`)
}
await invoke('worktrees:create', { repoId, /* ... */ })

Prevention

When it happens

Trigger: A worktrees:create invoke with a repoId that is not in the store — typo, stale renderer state after the repo was removed, or a race where the repo was deleted between the UI loading and the create call.

Common situations: Renderer holds a cached repo list after the user removed the repo; an automation/remote client sends an outdated repoId; or folder/SSH repo registration hasn't completed yet when create fires.

Related errors


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