paperclipai/paperclip · error · Error

Limit must be a positive integer

Error message

Limit must be a positive integer

What it means

Error "Limit must be a positive integer" thrown in paperclipai/paperclip.

Source

Thrown at ui/src/pages/tools/PoliciesTab.tsx:237

  if (!Number.isInteger(priority) || priority < 0 || priority > 10000) {
    throw new Error("Priority must be an integer from 0 to 10000");
  }
  const selectors: Record<string, unknown> = {};
  if (form.actorType !== ANY_VALUE) selectors.actorType = form.actorType;
  if (form.whenMode === "agent" && form.agentId !== ANY_VALUE) selectors.agentId = form.agentId;
  if (form.whenMode === "project" && form.projectId !== ANY_VALUE) selectors.projectId = form.projectId;
  if (form.usesMode === "app" && form.applicationId !== ANY_VALUE) selectors.applicationId = form.applicationId;
  if (form.connectionId !== ANY_VALUE) selectors.connectionId = form.connectionId;
  if (form.usesMode === "capability" && form.riskLevel !== ANY_VALUE) selectors.riskLevel = form.riskLevel;
  const toolNames = form.usesMode === "actions" ? parseList(form.toolNames) : [];
  if (toolNames.length === 1) selectors.toolName = toolNames[0];
  if (toolNames.length > 1) selectors.toolNames = toolNames;

  let config: Record<string, unknown> | null = null;
  if (form.policyType === "rate_limit") {
    const limit = Number(form.rateLimitLimit);
    const windowSeconds = Number(form.rateLimitWindowSeconds);
    if (!Number.isInteger(limit) || limit <= 0) throw new Error("Limit must be a positive integer");
    if (!Number.isInteger(windowSeconds) || windowSeconds <= 0) {
      throw new Error("Window must be a positive number of seconds");
    }
    config = { rateLimit: { limit, windowSeconds, keyBy: form.rateLimitKeyBy } };
  }

  return {
    name: form.name.trim(),
    description: form.description.trim() || null,
    policyType: form.policyType,
    priority,
    enabled: form.enabled,
    selectors,
    conditions: null,
    config,
  };
}

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Enter a positive integer for the limit.

When it happens

Trigger: Thrown at ui/src/pages/tools/PoliciesTab.tsx:237 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/049ddff7e24f6e47. Report an issue: GitHub.