stablyai/orca · error
Parent worktree workspace not found: ${parentWorkspace}
Error message
Parent worktree workspace not found: ${parentWorkspace} What it means
Thrown by validateWorkspaceLineageParentBeforeCreate when the parent scope parsed as type 'worktree' but store.getWorktreeMeta(parentScope.worktreeId) returns falsy — i.e. the referenced parent worktree has no metadata in the store. This is the worktree analog of the folder case: the validator confirms the declared parent worktree exists before attaching a child, preventing orphaned lineage.
Source
Thrown at src/main/ipc/worktree-remote.ts:208
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`)
return null
}
const parentScope = parseWorkspaceKey(args.parentWorkspace)View on GitHub (pinned to 1136503c6a)
Solutions
- Refresh the worktree list and select a parent worktree that currently exists in the store.
- If the intended parent is gone, create the new worktree at top level or under a surviving parent.
- Check store.getWorktreeMeta(parentId) returns truthy before calling createWorktree.
Defensive patterns
Strategy: validation
Validate before calling
const meta = store.getWorktreeMeta(parentScope.worktreeId)
if (!meta) {
showNotification('Parent worktree no longer exists.')
return
} Try / catch
try {
await createWorktree(args)
} catch (e) {
if (/Parent worktree workspace not found/.test((e as Error).message)) {
refreshWorktreeList()
showNotification('That parent worktree was removed; choose another.')
return
} else throw e
} Prevention
- Validate the parent worktree ID via store.getWorktreeMeta before creating a child.
- Refresh the worktree list when exposing the parent picker.
- Drop child-creation affordances tied to a worktree that has been removed/pruned.
When it happens
Trigger: createWorktree with a parentWorkspace key whose type is 'worktree' and whose worktreeId has no entry in store.getWorktreeMeta. The parent worktree was removed, its metadata pruned, or the ID is stale/malformed.
Common situations: Parent worktree was deleted (worktree remove + prune) after the child-creation flow captured its ID. Stale persisted state. Cross-session sync where the parent worktree metadata did not propagate. Race between parent removal and child creation.
Related errors
- Parent folder workspace not found: ${parentWorkspace}
- A worktree cannot be attached to itself.
- Invalid parent workspace: ${parentWorkspace}
- No worktrees on environment ${envName}
- No worktrees on environment ${envName}
AI-assisted analysis of stablyai/orca@1136503c6a (2026-08-12).
Data as JSON: /api/errors/888559af8c9e9e37.
Report an issue: GitHub.