paperclipai/paperclip · error · Error

root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_

Error message

root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_ROOT_ISSUES}.

What it means

Thrown by validatePaperclipIngestionProfile when a 'root_issues' source scope lists more issue ids than MAX_PAPERCLIP_PROFILE_ROOT_ISSUES (currently 25). It bounds how many root issues one scope can ingest. Reached through updatePaperclipIngestionProfile.

Source

Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:1012

  if (input.profile.sourceScopes.length > MAX_PAPERCLIP_INGESTION_PROFILE_SOURCE_COUNT) {
    throw new Error(`Paperclip ingestion profile sources exceed the hard cap of ${MAX_PAPERCLIP_INGESTION_PROFILE_SOURCE_COUNT}.`);
  }
  for (const scope of input.profile.sourceScopes) {
    if (scope.kind === "company_all" && input.space.slug !== DEFAULT_SPACE_SLUG) {
      throw new Error("Everything in the company is only available on the default wiki space.");
    }
    if (scope.kind === "selected_projects") {
      if (scope.projectIds.length > MAX_PAPERCLIP_PROFILE_SELECTED_PROJECTS) {
        throw new Error(`selected_projects exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_SELECTED_PROJECTS}.`);
      }
      for (const projectId of scope.projectIds) {
        const project = await ctx.projects.get(projectId, input.companyId);
        if (!project) throw new Error(`Project belongs to another company or does not exist: ${projectId}`);
      }
    }
    if (scope.kind === "root_issues") {
      if (scope.issueIds.length > MAX_PAPERCLIP_PROFILE_ROOT_ISSUES) {
        throw new Error(`root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_ROOT_ISSUES}.`);
      }
      for (const issueId of scope.issueIds) {
        const issue = await ctx.issues.get(issueId, input.companyId);
        if (!issue) throw new Error(`Issue belongs to another company or does not exist: ${issueId}`);
      }
    }
  }
}

export async function updatePaperclipIngestionProfile(ctx: PluginContext, input: {
  companyId: string;
  wikiId?: string | null;
  spaceSlug?: string | null;
  profile: unknown;
}): Promise<PaperclipIngestionProfileRead> {
  const wikiId = normalizeWikiId(input.wikiId);
  const space = await resolveSpace(ctx, { companyId: input.companyId, wikiId, spaceSlug: input.spaceSlug });
  const current = await profileForSpace(ctx, input.companyId, space);

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Trim scope.issueIds to at most 25 entries before submitting.
  2. Prefer 'selected_projects' or 'company_all' scope kinds when you need broader issue coverage instead of enumerating root issues.
  3. Split across multiple spaces if the workload truly requires more root issues.

Example fix

// before
scope.issueIds = allRootIssueIds; // 60 ids

// after
scope.issueIds = allRootIssueIds.slice(0, 25);
Defensive patterns

Strategy: validation

Validate before calling

const MAX_ROOT_ISSUES = 25;
function sanitizeRootIssuesScope(scope) {
  if (scope.kind !== "root_issues") return scope;
  if (scope.issueIds.length > MAX_ROOT_ISSUES) {
    throw new RangeError(`root_issues cap is ${MAX_ROOT_ISSUES}`);
  }
  return scope;
}
profile.sourceScopes.forEach(sanitizeRootIssuesScope);

Type guard

function isUnderRootIssuesCap(scope, cap = 25) {
  return scope.kind === "root_issues" ? scope.issueIds.length <= cap : true;
}

Try / catch

try {
  await updatePaperclipIngestionProfile(ctx, { companyId, spaceSlug, profile });
} catch (err) {
  if (/root_issues exceeds the hard cap/.test(err.message)) {
    profile.sourceScopes = profile.sourceScopes.map((s) =>
      s.kind === "root_issues" ? { ...s, issueIds: s.issueIds.slice(0, 25) } : s);
    return updatePaperclipIngestionProfile(ctx, { companyId, spaceSlug, profile });
  }
  throw err;
}

Prevention

When it happens

Trigger: Saving a profile with a 'root_issues' scope whose issueIds array exceeds 25 entries.

Common situations: Selecting a large backlog of root issues in the picker; pasting a long list of issue ids; treating the scope as unbounded.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/3654c3f165ffe995. Report an issue: GitHub.