paperclipai/paperclip · error

The named reviewer is not available in this company. Choose…

Error message

The named reviewer is not available in this company. Choose an available reviewer or report the concrete blocker.

What it means

After targetAgentId passes UUID validation, nativeCompletionFeedback looks up the reviewer agent scoped to the run's company and checks invokability via evaluateAgentInvokabilityFromDb. This error is thrown when no matching agent row exists in that company, or the agent exists but is not currently invokable (disabled, archived, unavailable). It prevents completion reports from assigning review to dead or foreign agents.

Solutions

  1. Query the company's agent list and choose an agent that currently exists and is invokable
  2. If the reviewer was removed, update the attention request to an available reviewer or report the concrete blocker in the completion report instead
  3. Verify the agent ID is from the same company as the task (cross-company IDs will never match)
Defensive patterns

Strategy: validation

Validate before calling

const reviewer = await api.getAgent(targetAgentId);
if (!reviewer || reviewer.companyId !== run.companyId || !reviewer.invokable) {
  throw new Error("Pick an available reviewer in this company before reporting completion.");
}

Type guard

const isInvokableCompanyReviewer = (a, companyId) => !!a && a.companyId === companyId && a.status === "active" && !a.paused && !a.terminated;

Try / catch

try { await feedback(payload); } catch (e) { if (e.message.includes("reviewer is not available")) { payload.signals.actionableAttentionRequests = payload.signals.actionableAttentionRequests.filter(r => r.ownerClass !== "agent"); await feedback(payload); } else throw e; }

Prevention

When it happens

Trigger: nativeCompletionFeedback with an actionable attention request whose targetAgentId is a valid UUID but either (a) no agent row with that id AND companyId equals run.companyId, or (b) evaluateAgentInvokabilityFromDb returns invokable:false.

Common situations: Reviewer agent was deleted or offboarded after the worker read its ID; reviewer belongs to a different company (cross-company ID leakage); reviewer is paused/terminated/archived so not invokable.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-18). Data as JSON: /api/errors/6493188389e24906. Report an issue: GitHub.

Appendix: source

Thrown at server/src/services/native-runtime/native-completion-feedback.ts:161

    signals.actionableAttentionRequests.length === 0
  ) {
    throw new Error(
      "needs_review requires a concrete decision and a named reviewer in attentionRequests. Continue unfinished work or checks; report done when complete. Paperclip will not create an automatic completion approval.",
    );
  }
  for (const request of signals.actionableAttentionRequests) {
    if (request.ownerClass !== "agent") continue;
    if (request.targetAgentId === run.agentId) {
      throw new Error("Name a different agent to review this task. A worker cannot review its own completion.");
    }
    if (!request.targetAgentId || !/^[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i.test(request.targetAgentId)) {
      throw new Error("Name the reviewer's exact agent ID in targetAgentId.");
    }
    const reviewer = await db.select().from(agents).where(and(
      eq(agents.id, request.targetAgentId), eq(agents.companyId, run.companyId),
    )).limit(1).then((rows) => rows[0]);
    if (!reviewer || !(await evaluateAgentInvokabilityFromDb(db, reviewer)).invokable) {
      throw new Error("The named reviewer is not available in this company. Choose an available reviewer or report the concrete blocker.");
    }
  }
  return "Completion report accepted. Task status will be committed after this turn and workspace finalization finish. Describe the completed work and any explicitly requested reviewer action; do not claim an approval is needed unless one was requested.";
}

View on GitHub (pinned to 3f1d897a7c)