{"record":{"id":"31169956d91855ec","repo":"paperclipai/paperclip","slug":"only-task-watchdog-agent-runs-can-create-watchdog","errorCode":null,"errorMessage":"Only task-watchdog agent runs can create watchdog-discovered product bug follow-ups","messagePattern":"Only task-watchdog agent runs can create watchdog-discovered product bug follow-ups","errorType":"http","errorClass":null,"httpStatus":403,"severity":"error","filePath":"server/src/routes/issues.ts","lineNumber":4946,"sourceCode":"      enabled: true as const,\n      watchdogParentIssueId: scope.watchdogIssueId,\n    };\n  }\n\n  function mergeIssueBlockerIds(\n    existing: unknown,\n    blockerIssueId: string | null | undefined,\n  ) {\n    const current = Array.isArray(existing)\n      ? existing.filter((value): value is string => typeof value === \"string\" && value.trim().length > 0)\n      : [];\n    return blockerIssueId ? [...new Set([...current, blockerIssueId])] : [...new Set(current)];\n  }\n\n  async function findCurrentSerializedWatchdogChild(parent: { id: string; companyId: string }) {\n    const children = await db\n      .select({\n        id: issueRows.id,\n        status: issueRows.status,\n      })\n      .from(issueRows)\n      .where(and(\n        eq(issueRows.companyId, parent.companyId),\n        eq(issueRows.parentId, parent.id),\n        inArray(issueRows.status, [\"todo\", \"in_progress\", \"in_review\", \"blocked\"]),\n        isNull(issueRows.hiddenAt),\n      ))\n      .orderBy(asc(issueRows.issueNumber), asc(issueRows.createdAt), asc(issueRows.id));\n    return children[0] ?? null;\n  }\n\n  async function blockWatchdogParentOnCurrentChild(input: {\n    actor: ReturnType<typeof getActorInfo>;\n    watchdogParentIssueId: string | null | undefined;\n    currentChildIssueId: string | null | undefined;\n  }) {","sourceCodeStart":4928,"sourceCodeEnd":4964,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/server/src/routes/issues.ts#L4928-L4964","documentation":"resolveTaskWatchdogProductBugFollowUp rejected a watchdog-discovered product bug follow-up request from a non-agent (board/user) actor; this special follow-up kind is reserved to task-watchdog agent runs.","triggerScenarios":"Thrown at server/src/routes/issues.ts:4782 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["This is an authorization rule, not a bug: perform the action with an actor that satisfies the stated constraint (board user, the owning agent, or an in-scope resource).","If access should be allowed, verify the actor's credentials/company scope and the resource's ownership before retrying."],"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-14T00:17:10.932Z"}