paperclipai/paperclip · error
${configured.warning}
Error message
${configured.warning} What it means
readManagedWorktreeInstanceOwnership resolved the worktree instance pointer but the configured instance root produced a warning (e.g. unresolvable or malformed pointer target) that is severe enough to throw rather than ignore. The pointer file's configured root is unusable for ownership resolution.
Source
Thrown at server/src/services/workspace-instance-cleanup.ts:255
expandHomePrefix(
worktreesDir?.trim()
|| process.env.PAPERCLIP_WORKTREES_DIR?.trim()
|| path.join(os.homedir(), ".paperclip-worktrees"),
),
);
return path.join(managedWorktreesDir, "instances");
}
export async function readManagedWorktreeInstanceOwnership(
workspacePath: string,
worktreesDir?: string,
): Promise<{ instanceRoot: string; instanceId: string } | null> {
const pointer = await readWorktreeInstancePointer(workspacePath);
if (!pointer) return null;
const configured = resolveConfiguredInstanceRoot(pointer);
if ("warning" in configured) {
if (!configured.warning) return null;
throw new Error(configured.warning);
}
const managedInstancesDir = resolveManagedInstancesDir(worktreesDir);
if (!isStrictChildPath(configured.instanceRoot, managedInstancesDir)) {
throw new Error(
`Refusing to record worktree instance ownership for "${configured.instanceRoot}" because it is outside "${managedInstancesDir}".`,
);
}
return configured;
}
export async function cleanupWorktreeInstanceArtifacts(input: {
pointer: WorktreeInstancePointer;
workspaceId: string;
workspacePath: string;
expectedInstanceId: string;
expectedInstanceRoot: string | null;
recorder?: WorkspaceOperationRecorder | null;
worktreesDir?: string;View on GitHub (pinned to a7e689b3c3)
Solutions
- A configured cleanup warning was raised; read the warning text for the specific condition and resolve it before proceeding.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/workspace-instance-cleanup.ts:233 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@a7e689b3c3 (2026-08-18).
Data as JSON: /api/errors/b28c635b9c4ec707.
Report an issue: GitHub.