stablyai/orca · error

Parent folder workspace not found: ${parentWorkspace}

Error message

Parent folder workspace not found: ${parentWorkspace}

What it means

Thrown by validateWorkspaceLineageParentBeforeCreate when the parent scope parsed as type 'folder' but store.getFolderWorkspace(parentScope.folderWorkspaceId) returns falsy — i.e. the referenced folder workspace does not exist in the store. The lineage validator confirms the declared parent actually exists before allowing a child to attach to it, preventing dangling lineage references.

Source

Thrown at src/main/ipc/worktree-remote.ts:205

}

function validateWorkspaceLineageParentBeforeCreate(
  store: Store,
  parentWorkspace: CreateWorktreeArgs['parentWorkspace'],
  childWorkspaceKey: ReturnType<typeof worktreeWorkspaceKey>
): void {
  if (!parentWorkspace) {
    return
  }
  if (parentWorkspace === childWorkspaceKey) {
    throw new Error('A worktree cannot be attached to itself.')
  }
  const parentScope = parseWorkspaceKey(parentWorkspace)
  if (!parentScope) {
    throw new Error(`Invalid parent workspace: ${parentWorkspace}`)
  }
  if (parentScope.type === 'folder' && !store.getFolderWorkspace(parentScope.folderWorkspaceId)) {
    throw new Error(`Parent folder workspace not found: ${parentWorkspace}`)
  }
  if (parentScope.type === 'worktree' && !store.getWorktreeMeta(parentScope.worktreeId)) {
    throw new Error(`Parent worktree workspace not found: ${parentWorkspace}`)
  }
}

function recordWorkspaceLineageForCreatedWorktree(
  store: Store,
  args: CreateWorktreeArgs,
  worktree: Worktree,
  createdAt: number
): CreateWorktreeResult['workspaceLineage'] {
  if (!args.parentWorkspace || !worktree.instanceId) {
    return null
  }
  const childWorkspaceKey = worktreeWorkspaceKey(worktree.id)
  if (args.parentWorkspace === childWorkspaceKey) {
    console.warn(`[worktree-create] refusing to attach ${worktree.id} to itself`)

View on GitHub (pinned to 1136503c6a)

Solutions

  1. Refresh the folder workspace list and rebind the parent selector to an existing folder ID.
  2. If the folder was deleted intentionally, choose a different parent or create top-level.
  3. Validate the folder ID exists in the store before issuing createWorktree.
Defensive patterns

Strategy: validation

Validate before calling

const folder = store.getFolderWorkspace(parentScope.folderWorkspaceId)
if (!folder) {
  showNotification('Parent folder workspace no longer exists.')
  return
}

Try / catch

try {
  await createWorktree(args)
} catch (e) {
  if (/Parent folder workspace not found/.test((e as Error).message)) {
    refreshFolderList()
    showNotification('That folder was deleted; choose another parent.')
    return
  } else throw e
}

Prevention

When it happens

Trigger: createWorktree with a parentWorkspace key whose type is 'folder' and whose folderWorkspaceId does not resolve via store.getFolderWorkspace. The folder was deleted, never created, or its ID is stale.

Common situations: User deleted the folder workspace after the create-child flow captured its key. A stale ID is replayed from persisted state. A sync/import produced a key referencing a folder that was not imported. ID typo or format drift.

Related errors


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