paperclipai/paperclip · error
Backfill work items must target a projectId or rootIssueId…
Error message
Backfill work items must target a projectId or rootIssueId; whole-company backfill is not allowed.
What it means
Error "Backfill work items must target a projectId or rootIssueId; whole-company backfill is not allowed." thrown in paperclipai/paperclip.
Solutions
- Set projectId or rootIssueId on the backfill work item; company-wide backfill is not supported.
When it happens
Trigger: Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:2904 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@5716fe907e (2026-08-18).
Data as JSON: /api/errors/0889bb4ea59d83f1.
Report an issue: GitHub.
Appendix: source
Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:2902
AND id = $6`,
[input.companyId, wikiId, input.runId, input.sourceWindowEnd, input.sourceHash, input.cursorId, space.id],
);
}
return {
status: input.status,
cursorAdvanced: input.status === "succeeded" && Boolean(input.cursorId && input.sourceHash && input.sourceWindowEnd),
};
}
export async function createPaperclipDistillationWorkItem(ctx: PluginContext, input: PaperclipDistillationWorkItemInput) {
const wikiId = normalizeWikiId(input.wikiId);
assertPaperclipSourceScopePayload(input);
const space = await requirePaperclipIngestionPolicy(ctx, { companyId: input.companyId, wikiId, spaceSlug: input.spaceSlug }, "queue", { requireEnabledProfile: true });
const itemId = randomUUID();
const scope = paperclipCursorScopeMetadata(input);
if (input.kind === "backfill" && !scope.projectId && !scope.rootIssueId) {
throw new Error("Backfill work items must target a projectId or rootIssueId; whole-company backfill is not allowed.");
}
await ctx.db.execute(
`INSERT INTO ${distillationWorkItemTable(ctx)} AS paperclip_distillation_work_items
(id, company_id, wiki_id, space_id, work_item_kind, status, priority, project_id, root_issue_id, requested_by_issue_id, idempotency_key, metadata)
VALUES ($1, $2, $3, $11, $4, 'pending', $5, $6, $7, $8, $9, $10::jsonb)
ON CONFLICT (company_id, wiki_id, space_id, idempotency_key)
DO UPDATE SET priority = EXCLUDED.priority,
metadata = paperclip_distillation_work_items.metadata || EXCLUDED.metadata,
updated_at = now()`,
[
itemId,
input.companyId,
wikiId,
input.kind,
input.priority ?? "medium",
scope.projectId,
scope.rootIssueId,
input.requestedByIssueId ?? null,View on GitHub (pinned to 5716fe907e)