paperclipai/paperclip · error · Error

kind must be manual, retry, backfill, priority_override, or

Error message

kind must be manual, retry, backfill, priority_override, or review_patch

What it means

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.

Source

Thrown at packages/plugins/plugin-llm-wiki/src/worker.ts:704

        autoApply: params.autoApply === true ? true : params.autoApply === false ? false : undefined,
        expectedProjectPageHash: stringField(params.expectedProjectPageHash),
        includeSupportingPages: params.includeSupportingPages !== false,
        workItemId: workItem.workItemId,
        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,
      });
    });

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Use one of: manual, retry, backfill, priority_override, review_patch (note priority_override and review_patch use underscores).
  2. For on-demand distillation use 'manual'; for re-running a failed run use 'retry'.
  3. Check the plugin version if you expect a newer kind.

Example fix

// before
ctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'auto' });
// after
ctx.actions.run('create-paperclip-distillation-work-item', { companyId, kind: 'manual' });
Defensive patterns

Strategy: type-guard

Validate before calling

const KINDS = ['manual','retry','backfill','priority_override','review_patch'] as const;
function assertWorkItemKind(value: unknown) {
  if (typeof value !== 'string' || !(KINDS as readonly string[]).includes(value)) {
    throw new Error(`kind must be one of ${KINDS.join(', ')}`);
  }
}

Type guard

const WORK_ITEM_KINDS = ['manual','retry','backfill','priority_override','review_patch'] as const;
type WorkItemKind = typeof WORK_ITEM_KINDS[number];
function isWorkItemKind(value: unknown): value is WorkItemKind {
  return typeof value === 'string' && (WORK_ITEM_KINDS as readonly string[]).includes(value);
}

Prevention

When it happens

Trigger: Calling create-paperclip-distillation-work-item with kind missing, blank, or a value like 'auto', 'scheduled', 'distill'.

Common situations: 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.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/7dd1915222acdbf9. Report an issue: GitHub.