{"record":{"id":"1b7bc658e788c937","repo":"paperclipai/paperclip","slug":"annotation-thread-not-found","errorCode":null,"errorMessage":"Annotation thread not found","messagePattern":"Annotation thread not found","errorType":"http","errorClass":null,"httpStatus":404,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":7517,"sourceCode":"      agentApiKeyId: actor.agentApiKeyId,\n      action: created ? \"issue.watchdog_created\" : \"issue.watchdog_updated\",\n      entityType: \"issue\",\n      entityId: issue.id,\n      details: {\n        identifier: issue.identifier,\n        watchdogId: watchdog.id,\n        watchdogAgentId: watchdog.watchdogAgentId,\n        instructionsChanged: (existingWatchdog?.instructions ?? null) !== (watchdog.instructions ?? null),\n      },\n    });\n    await queueTaskWatchdogEvaluation(issue, actor.runId);\n    res.json(watchdog);\n  });\n\n  router.delete(\"/issues/:id/watchdog\", async (req, res) => {\n    const id = req.params.id as string;\n    const issue = await getAccessibleResource(req, res, getIssueById(req, id), \"Issue not found\");\n    if (!issue) return;\n    if (!(await assertIssueReadAllowed(req, res, issue))) return;\n    if (!(await assertAgentIssueMutationAllowed(req, res, issue))) return;\n    if (await rejectTaskWatchdogConfigMutation(req, res)) return;\n    if (await assertLowTrustControlPlaneDenied(req, res, issue.companyId, issue)) return;\n\n    const actor = getActorInfo(req);\n    const disabled = await taskWatchdogsSvc.disableForIssue(issue.companyId, issue.id, {\n      agentId: actor.agentId,\n      userId: actor.actorType === \"user\" ? actor.actorId : null,\n      runId: actor.runId,\n    });\n    if (disabled) {\n      await logActivity(db, {\n        companyId: issue.companyId,\n        actorType: actor.actorType,\n        actorId: actor.actorId,\n        agentId: actor.agentId,\n        runId: actor.runId,","sourceCodeStart":7499,"sourceCodeEnd":7535,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L7499-L7535","documentation":"404 response from GET /issues/:id/documents/:key/annotations/:threadId. Fires after the document resolves but no annotation thread with the given threadId exists on that document (or the thread belongs to another document/issue), so the thread lookup returns null.","triggerScenarios":"Thrown at server/src/routes/issues.ts:7073 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Verify the id in the request path or body refers to an existing record in this company; re-list the parent collection to get a valid id.","Check that the record was not deleted or archived, and that the request is scoped to the correct companyId."],"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"}