paperclipai/paperclip · error

Task-watchdog product bug follow-up target is outside the wa

Error message

Task-watchdog product bug follow-up target is outside the watchdog company

What it means

403 from the watchdog product-bug follow-up guard: the authenticated run is watchdog-scoped, but the target company differs from the watchdog's own company, so the follow-up crosses a company boundary.

Source

Thrown at server/src/routes/issues.ts:4966

      })
      .from(issueRows)
      .where(and(
        eq(issueRows.companyId, parent.companyId),
        eq(issueRows.parentId, parent.id),
        inArray(issueRows.status, ["todo", "in_progress", "in_review", "blocked"]),
        isNull(issueRows.hiddenAt),
      ))
      .orderBy(asc(issueRows.issueNumber), asc(issueRows.createdAt), asc(issueRows.id));
    return children[0] ?? null;
  }

  async function blockWatchdogParentOnCurrentChild(input: {
    actor: ReturnType<typeof getActorInfo>;
    watchdogParentIssueId: string | null | undefined;
    currentChildIssueId: string | null | undefined;
  }) {
    if (!input.watchdogParentIssueId || !input.currentChildIssueId) return;
    const watchdogParent = await svc.getById(input.watchdogParentIssueId);
    if (!watchdogParent || watchdogParent.originKind !== TASK_WATCHDOG_ORIGIN_KIND) return;
    if (watchdogParent.status !== "in_progress" && watchdogParent.status !== "blocked") return;

    const relations = await svc.getRelationSummaries(watchdogParent.id);
    const nextBlockedByIssueIds = mergeIssueBlockerIds(
      relations.blockedBy?.map((relation) => relation.id) ?? [],
      input.currentChildIssueId,
    );
    await svc.update(watchdogParent.id, {
      status: "blocked",
      blockedByIssueIds: nextBlockedByIssueIds,
      actorAgentId: input.actor.agentId,
      actorUserId: input.actor.actorType === "user" ? input.actor.actorId : null,
    });
    await logActivity(db, {
      companyId: watchdogParent.companyId,
      actorType: input.actor.actorType,
      actorId: input.actor.actorId,

View on GitHub (pinned to 01ad858492)

Solutions

  1. Correct the request so it satisfies the condition stated in the error message, then retry; see the throwing line in the named file for the exact check.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at server/src/routes/issues.ts:4802 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/38ce934d6d77edd5. Report an issue: GitHub.