{"record":{"id":"400a384759fdf1c2","repo":"paperclipai/paperclip","slug":"operationtype-must-be-ingest-query-lint-file-as","errorCode":null,"errorMessage":"operationType must be ingest, query, lint, file-as-page, index, distill, or backfill","messagePattern":"operationType must be ingest, query, lint, file-as-page, index, distill, or backfill","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/worker.ts","lineNumber":290,"sourceCode":"      return archiveSpace(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        wikiId: stringField(params.wikiId),\n        spaceSlug: stringField(params.spaceSlug),\n      });\n    });\n\n    ctx.actions.register(\"create-operation\", async (params) => {\n      const operationType = stringField(params.operationType);\n      if (\n        operationType !== \"ingest\" &&\n        operationType !== \"query\" &&\n        operationType !== \"lint\" &&\n        operationType !== \"file-as-page\" &&\n        operationType !== \"index\" &&\n        operationType !== \"distill\" &&\n        operationType !== \"backfill\"\n      ) {\n        throw new Error(\"operationType must be ingest, query, lint, file-as-page, index, distill, or backfill\");\n      }\n      return createOperationIssue(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        wikiId: stringField(params.wikiId),\n        spaceSlug: stringField(params.spaceSlug),\n        operationType,\n        title: stringField(params.title),\n        prompt: stringField(params.prompt),\n        useCheapModelProfile: params.useCheapModelProfile === true,\n      });\n    });\n\n    ctx.actions.register(\"capture-source\", async (params) => {\n      return captureWikiSource(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        wikiId: stringField(params.wikiId),\n        spaceSlug: stringField(params.spaceSlug),\n        sourceType: stringField(params.sourceType),","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/worker.ts#L272-L308","documentation":"Thrown by the create-operation worker action when params.operationType is not one of ingest|query|lint|file-as-page|index|distill|backfill. operationType selects which kind of Wiki operation issue to create; an unknown value cannot be routed to a handler.","triggerScenarios":"Calling the create-operation action with operationType missing, blank, or a value outside the seven allowed (e.g. 'search', 'embedding', 'qa').","commonSituations":"Caller uses a free-text operation type; typo (e.g. 'file_as_page' vs 'file-as-page'); version mismatch where the caller expects a newer operation type not yet supported by this plugin version.","solutions":["Pass one of: ingest, query, lint, file-as-page, index, distill, backfill.","Use kebab-case exactly ('file-as-page', not 'file_as_page').","Upgrade the plugin if the caller requires an operation type added in a newer version."],"exampleFix":"// before\nctx.actions.run('create-operation', { companyId, operationType: 'search' });\n// after\nctx.actions.run('create-operation', { companyId, operationType: 'query' });","handlingStrategy":"type-guard","validationCode":"const OPERATION_TYPES = ['ingest','query','lint','file-as-page','index','distill','backfill'] as const;\nfunction assertOperationType(value: unknown) {\n  if (typeof value !== 'string' || !(OPERATION_TYPES as readonly string[]).includes(value)) {\n    throw new Error(`operationType must be one of ${OPERATION_TYPES.join(', ')}`);\n  }\n}","typeGuard":"const OPERATION_TYPES = ['ingest','query','lint','file-as-page','index','distill','backfill'] as const;\ntype WikiOperationType = typeof OPERATION_TYPES[number];\nfunction isOperationType(value: unknown): value is WikiOperationType {\n  return typeof value === 'string' && (OPERATION_TYPES as readonly string[]).includes(value);\n}","tryCatchPattern":null,"preventionTips":["Restrict operationType to a dropdown sourced from the constant.","Use kebab-case exactly ('file-as-page')."],"tags":["paperclip","wiki","operation","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}