{"record":{"id":"bff389b2730d7134","repo":"paperclipai/paperclip","slug":"invalid-work-product-payload","errorCode":null,"errorMessage":"Invalid work product payload","messagePattern":"Invalid work product payload","errorType":"http","errorClass":null,"httpStatus":422,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":8122,"sourceCode":"      if (!keyParsed.success) {\n        res.status(400).json({ error: \"Invalid document key\", details: keyParsed.error.issues });\n        return;\n      }\n\n      const { actor, annotationActor } = annotationActorInput(req);\n      const referenceSummaryBefore = await issueReferencesSvc.listIssueReferenceSummary(issue.id);\n      const comment = await documentAnnotationsSvc.addComment(\n        issue.id,\n        keyParsed.data,\n        req.params.threadId as string,\n        req.body,\n        annotationActor,\n      );\n      await issueReferencesSvc.syncAnnotationComment(comment.id);\n      const referenceSummaryAfter = await issueReferencesSvc.listIssueReferenceSummary(issue.id);\n      const referenceDiff = issueReferencesSvc.diffIssueReferenceSummary(referenceSummaryBefore, referenceSummaryAfter);\n\n      await logActivity(db, {\n        companyId: issue.companyId,\n        actorType: actor.actorType,\n        actorId: actor.actorId,\n        agentId: actor.agentId,\n        runId: actor.runId,\n        agentApiKeyId: actor.agentApiKeyId,\n        action: \"issue.document_annotation_comment_added\",\n        entityType: \"issue\",\n        entityId: issue.id,\n        details: {\n          key: keyParsed.data,\n          documentKey: keyParsed.data,\n          threadId: comment.threadId,\n          commentId: comment.id,\n          bodySnippet: comment.body.slice(0, 120),\n          ...summarizeIssueReferenceActivityDetails({\n            addedReferencedIssues: referenceDiff.addedReferencedIssues.map(summarizeIssueRelationForActivity),\n            removedReferencedIssues: referenceDiff.removedReferencedIssues.map(summarizeIssueRelationForActivity),","sourceCodeStart":8104,"sourceCodeEnd":8140,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L8104-L8140","documentation":"422 validation failure on work product creation for an issue. Fires when req.body fails the work product schema (missing/invalid kind, content, or metadata fields), before the record is persisted.","triggerScenarios":"Thrown at server/src/routes/issues.ts:7636 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Fix the offending parameter to satisfy the constraint stated in the error message (type, range, or allowed values), then retry.","Refer to the route's request validation in the named file and the shared validators for the accepted format."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}