{"record":{"id":"7dd1915222acdbf9","repo":"paperclipai/paperclip","slug":"kind-must-be-manual-retry-backfill-priority-ove","errorCode":null,"errorMessage":"kind must be manual, retry, backfill, priority_override, or review_patch","messagePattern":"kind must be manual, retry, backfill, priority_override, or review_patch","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/worker.ts","lineNumber":704,"sourceCode":"        autoApply: params.autoApply === true ? true : params.autoApply === false ? false : undefined,\n        expectedProjectPageHash: stringField(params.expectedProjectPageHash),\n        includeSupportingPages: params.includeSupportingPages !== false,\n        workItemId: workItem.workItemId,\n        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    });","sourceCodeStart":686,"sourceCodeEnd":722,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/worker.ts#L686-L722","documentation":"Thrown by the create-paperclip-distillation-work-item worker action when params.kind is not one of manual|retry|backfill|priority_override|review_patch. kind controls the work item's semantics and idempotency, so an unknown kind cannot be queued.","triggerScenarios":"Calling create-paperclip-distillation-work-item with kind missing, blank, or a value like 'auto', 'scheduled', 'distill'.","commonSituations":"Caller invents a kind; snake_case used instead of snake_case shown ('priority-override' vs 'priority_override'); version drift where caller expects a kind not yet supported.","solutions":["Use one of: manual, retry, backfill, priority_override, review_patch (note priority_override and review_patch use underscores).","For on-demand distillation use 'manual'; for re-running a failed run use 'retry'.","Check the plugin version if you expect a newer kind."],"exampleFix":"// before\nctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'auto' });\n// after\nctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'manual' });","handlingStrategy":"type-guard","validationCode":"const KINDS = ['manual','retry','backfill','priority_override','review_patch'] as const;\nfunction assertWorkItemKind(value: unknown) {\n  if (typeof value !== 'string' || !(KINDS as readonly string[]).includes(value)) {\n    throw new Error(`kind must be one of ${KINDS.join(', ')}`);\n  }\n}","typeGuard":"const WORK_ITEM_KINDS = ['manual','retry','backfill','priority_override','review_patch'] as const;\ntype WorkItemKind = typeof WORK_ITEM_KINDS[number];\nfunction isWorkItemKind(value: unknown): value is WorkItemKind {\n  return typeof value === 'string' && (WORK_ITEM_KINDS as readonly string[]).includes(value);\n}","tryCatchPattern":null,"preventionTips":["Use underscores for priority_override / review_patch.","Source kind values from the plugin's type definitions."],"tags":["paperclip","distillation","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}