{"record":{"id":"c6c19e3ddbc6360e","repo":"paperclipai/paperclip","slug":"priority-must-be-critical-high-medium-or-low","errorCode":null,"errorMessage":"priority must be critical, high, medium, or low","messagePattern":"priority must be critical, high, medium, or low","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/worker.ts","lineNumber":708,"sourceCode":"        operationIssueId: operation.issue.id,\n      });\n      return { ...result, workItem, operation };\n    });\n\n    ctx.actions.register(\"create-paperclip-distillation-work-item\", async (params) => {\n      const kind = stringField(params.kind);\n      if (\n        kind !== \"manual\" &&\n        kind !== \"retry\" &&\n        kind !== \"backfill\" &&\n        kind !== \"priority_override\" &&\n        kind !== \"review_patch\"\n      ) {\n        throw new Error(\"kind must be manual, retry, backfill, priority_override, or review_patch\");\n      }\n      const priority = stringField(params.priority);\n      if (priority && priority !== \"critical\" && priority !== \"high\" && priority !== \"medium\" && priority !== \"low\") {\n        throw new Error(\"priority must be critical, high, medium, or low\");\n      }\n      return createPaperclipDistillationWorkItem(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        wikiId: stringField(params.wikiId),\n        spaceSlug: stringField(params.spaceSlug),\n        kind,\n        projectId: stringField(params.projectId),\n        rootIssueId: stringField(params.rootIssueId),\n        requestedByIssueId: stringField(params.requestedByIssueId),\n        priority: priority as \"critical\" | \"high\" | \"medium\" | \"low\" | null,\n        idempotencyKey: stringField(params.idempotencyKey),\n        metadata: typeof params.metadata === \"object\" && params.metadata != null ? params.metadata as Record<string, unknown> : null,\n      });\n    });\n\n    ctx.actions.register(\"file-as-page\", async (params) => {\n      return fileQueryAnswerAsPage(ctx, {\n        companyId: readCompanyIdFromParams(params),","sourceCodeStart":690,"sourceCodeEnd":726,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/worker.ts#L690-L726","documentation":"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.","triggerScenarios":"Passing priority as a number, an unknown label ('urgent', 'normal', '1'), or a mis-cased value ('High').","commonSituations":"Caller forwards a priority from an external system whose scale differs; numeric priority passed instead of label; case mismatch.","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."],"exampleFix":"// before\nctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'manual', priority: 'urgent' });\n// after\nctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'manual', priority: 'high' });","handlingStrategy":"type-guard","validationCode":"const PRIORITIES = ['critical','high','medium','low'] as const;\nfunction assertPriority(value: string | null | undefined) {\n  if (value != null && value !== '' && !(PRIORITIES as readonly string[]).includes(value)) {\n    throw new Error(`priority must be one of ${PRIORITIES.join(', ')}`);\n  }\n}","typeGuard":"const PRIORITIES = ['critical','high','medium','low'] as const;\ntype WorkItemPriority = typeof PRIORITIES[number];\nfunction isPriority(value: unknown): value is WorkItemPriority {\n  return typeof value === 'string' && (PRIORITIES as readonly string[]).includes(value);\n}","tryCatchPattern":null,"preventionTips":["Map external priority scales to the four valid labels.","Omit priority to accept the default rather than guessing."],"tags":["paperclip","distillation","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}