paperclipai/paperclip · error · Error
priority must be critical, high, medium, or low
Error message
priority must be critical, high, medium, or low
What it means
Thrown by the create-paperclip-distillation-work-item worker action when params.priority is present and non-blank but not one of critical|high|medium|low. priority is optional (null allowed), but if supplied it must be a valid queue priority.
Source
Thrown at packages/plugins/plugin-llm-wiki/src/worker.ts:708
operationIssueId: operation.issue.id,
});
return { ...result, workItem, operation };
});
ctx.actions.register("create-paperclip-distillation-work-item", async (params) => {
const kind = stringField(params.kind);
if (
kind !== "manual" &&
kind !== "retry" &&
kind !== "backfill" &&
kind !== "priority_override" &&
kind !== "review_patch"
) {
throw new Error("kind must be manual, retry, backfill, priority_override, or review_patch");
}
const priority = stringField(params.priority);
if (priority && priority !== "critical" && priority !== "high" && priority !== "medium" && priority !== "low") {
throw new Error("priority must be critical, high, medium, or low");
}
return createPaperclipDistillationWorkItem(ctx, {
companyId: readCompanyIdFromParams(params),
wikiId: stringField(params.wikiId),
spaceSlug: stringField(params.spaceSlug),
kind,
projectId: stringField(params.projectId),
rootIssueId: stringField(params.rootIssueId),
requestedByIssueId: stringField(params.requestedByIssueId),
priority: priority as "critical" | "high" | "medium" | "low" | null,
idempotencyKey: stringField(params.idempotencyKey),
metadata: typeof params.metadata === "object" && params.metadata != null ? params.metadata as Record<string, unknown> : null,
});
});
ctx.actions.register("file-as-page", async (params) => {
return fileQueryAnswerAsPage(ctx, {
companyId: readCompanyIdFromParams(params),View on GitHub (pinned to 67001ec6eb)
Solutions
- Use one of: critical, high, medium, low (lowercase).
- Omit priority entirely to accept the default (the action passes null when absent).
- Map external priorities to the four valid labels before calling.
Example fix
// before
ctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'manual', priority: 'urgent' });
// after
ctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'manual', priority: 'high' }); Defensive patterns
Strategy: type-guard
Validate before calling
const PRIORITIES = ['critical','high','medium','low'] as const;
function assertPriority(value: string | null | undefined) {
if (value != null && value !== '' && !(PRIORITIES as readonly string[]).includes(value)) {
throw new Error(`priority must be one of ${PRIORITIES.join(', ')}`);
}
} Type guard
const PRIORITIES = ['critical','high','medium','low'] as const;
type WorkItemPriority = typeof PRIORITIES[number];
function isPriority(value: unknown): value is WorkItemPriority {
return typeof value === 'string' && (PRIORITIES as readonly string[]).includes(value);
} Prevention
- Map external priority scales to the four valid labels.
- Omit priority to accept the default rather than guessing.
When it happens
Trigger: Passing priority as a number, an unknown label ('urgent', 'normal', '1'), or a mis-cased value ('High').
Common situations: Caller forwards a priority from an external system whose scale differs; numeric priority passed instead of label; case mismatch.
Related errors
- Paperclip ingestion fan-out exceeds the hard cap of ${MAX_PA
- Backfill work items must target a projectId or rootIssueId;
- projectId or rootIssueId is required
- status must be succeeded, failed, or review_required
- runId is required
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/c6c19e3ddbc6360e.
Report an issue: GitHub.