stablyai/orca · error · Error

Folder workspaces do not have local Git branches.

Error message

Folder workspaces do not have local Git branches.

What it means

Thrown by 'worktrees:forceDeletePreservedBranch' when the resolved repo is a folder workspace (isFolderRepo(repo) is true). Folder workspaces are not git worktrees and have no local git branches, so a force-delete-preserved-branch request is meaningless. The check follows the repo lookup and short-circuits before any git/SSH write path is touched.

Source

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

        worktreeId: string
        branchName: string
        expectedHead: string
        hostId?: ExecutionHostId
      }
    ): Promise<ForceDeleteWorktreeBranchResult> => {
      const { repoId } = parseWorktreeId(args.worktreeId)
      const cleanupTarget = getPreservedBranchCleanupTarget(
        args.worktreeId,
        args.branchName,
        args.expectedHead,
        args.hostId
      )
      const repo = getRepoForWorktreeRemoval(store, repoId, cleanupTarget.hostId)
      if (!repo) {
        throw new Error(`Repo not found: ${repoId}`)
      }
      if (isFolderRepo(repo)) {
        throw new Error('Folder workspaces do not have local Git branches.')
      }

      if (repo.connectionId) {
        const provider = requireSshGitProvider(repo.connectionId)
        // Why: SSH needs the write-capable relay RPC; the read-only git.exec allowlist rejects these worktree/update-ref/config writes.
        await provider.forceDeletePreservedBranch(
          repo.path,
          cleanupTarget.branchName,
          cleanupTarget.head
        )
        await cleanupUnusedWorktreePushTargetRemoteSsh(
          provider,
          repo.path,
          args.worktreeId,
          cleanupTarget.pushTarget,
          store
        )
      } else {

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Suppress the force-delete-branch UI for folder repos (guard with !isFolderRepo(repo)).
  2. If a cleanup badge is stuck, dismiss it client-side rather than invoking the IPC.
  3. Reopen the project as a git worktree if branch management is actually needed.

Example fix

// before
if (repo) { await forceDeletePreservedBranch(repo, branchName, head) }
// after
if (repo && !isFolderRepo(repo)) { await forceDeletePreservedBranch(repo, branchName, head) }
Defensive patterns

Strategy: type-guard

Validate before calling

if (repo && isFolderRepo(repo)) { hideForceDeleteBranchUI(); return }

Type guard

function supportsLocalBranches(repo: Repo): boolean {
  return !isFolderRepo(repo)
}

Try / catch

try { await forceDeletePreservedBranch(repo, branchName, head) }
catch (e) {
  if (/do not have local Git branches/.test(String((e as Error).message))) dismissBranchBadge()
  else throw e
}

Prevention

When it happens

Trigger: Calling forceDeletePreservedBranch on a worktreeId whose repo resolves to a folder workspace, e.g. the user opened a plain folder project and the UI still shows a leftover 'force delete branch' affordance from a previous git worktree session.

Common situations: Converting a git project to a folder project but a stale branch-cleanup notification persists. UI component reused across repo types without checking isFolderRepo. Scripted calls iterating all repos without filtering.

Related errors


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