{"record":{"id":"3654c3f165ffe995","repo":"paperclipai/paperclip","slug":"root-issues-exceeds-the-hard-cap-of-max-papercli","errorCode":null,"errorMessage":"root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_ROOT_ISSUES}.","messagePattern":"root_issues exceeds the hard cap of (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":1012,"sourceCode":"  if (input.profile.sourceScopes.length > MAX_PAPERCLIP_INGESTION_PROFILE_SOURCE_COUNT) {\n    throw new Error(`Paperclip ingestion profile sources exceed the hard cap of ${MAX_PAPERCLIP_INGESTION_PROFILE_SOURCE_COUNT}.`);\n  }\n  for (const scope of input.profile.sourceScopes) {\n    if (scope.kind === \"company_all\" && input.space.slug !== DEFAULT_SPACE_SLUG) {\n      throw new Error(\"Everything in the company is only available on the default wiki space.\");\n    }\n    if (scope.kind === \"selected_projects\") {\n      if (scope.projectIds.length > MAX_PAPERCLIP_PROFILE_SELECTED_PROJECTS) {\n        throw new Error(`selected_projects exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_SELECTED_PROJECTS}.`);\n      }\n      for (const projectId of scope.projectIds) {\n        const project = await ctx.projects.get(projectId, input.companyId);\n        if (!project) throw new Error(`Project belongs to another company or does not exist: ${projectId}`);\n      }\n    }\n    if (scope.kind === \"root_issues\") {\n      if (scope.issueIds.length > MAX_PAPERCLIP_PROFILE_ROOT_ISSUES) {\n        throw new Error(`root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_ROOT_ISSUES}.`);\n      }\n      for (const issueId of scope.issueIds) {\n        const issue = await ctx.issues.get(issueId, input.companyId);\n        if (!issue) throw new Error(`Issue belongs to another company or does not exist: ${issueId}`);\n      }\n    }\n  }\n}\n\nexport async function updatePaperclipIngestionProfile(ctx: PluginContext, input: {\n  companyId: string;\n  wikiId?: string | null;\n  spaceSlug?: string | null;\n  profile: unknown;\n}): Promise<PaperclipIngestionProfileRead> {\n  const wikiId = normalizeWikiId(input.wikiId);\n  const space = await resolveSpace(ctx, { companyId: input.companyId, wikiId, spaceSlug: input.spaceSlug });\n  const current = await profileForSpace(ctx, input.companyId, space);","sourceCodeStart":994,"sourceCodeEnd":1030,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L994-L1030","documentation":"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.","triggerScenarios":"Saving a profile with a 'root_issues' scope whose issueIds array exceeds 25 entries.","commonSituations":"Selecting a large backlog of root issues in the picker; pasting a long list of issue ids; treating the scope as unbounded.","solutions":["Trim scope.issueIds to at most 25 entries before submitting.","Prefer 'selected_projects' or 'company_all' scope kinds when you need broader issue coverage instead of enumerating root issues.","Split across multiple spaces if the workload truly requires more root issues."],"exampleFix":"// before\nscope.issueIds = allRootIssueIds; // 60 ids\n\n// after\nscope.issueIds = allRootIssueIds.slice(0, 25);","handlingStrategy":"validation","validationCode":"const MAX_ROOT_ISSUES = 25;\nfunction sanitizeRootIssuesScope(scope) {\n  if (scope.kind !== \"root_issues\") return scope;\n  if (scope.issueIds.length > MAX_ROOT_ISSUES) {\n    throw new RangeError(`root_issues cap is ${MAX_ROOT_ISSUES}`);\n  }\n  return scope;\n}\nprofile.sourceScopes.forEach(sanitizeRootIssuesScope);","typeGuard":"function isUnderRootIssuesCap(scope, cap = 25) {\n  return scope.kind === \"root_issues\" ? scope.issueIds.length <= cap : true;\n}","tryCatchPattern":"try {\n  await updatePaperclipIngestionProfile(ctx, { companyId, spaceSlug, profile });\n} catch (err) {\n  if (/root_issues exceeds the hard cap/.test(err.message)) {\n    profile.sourceScopes = profile.sourceScopes.map((s) =>\n      s.kind === \"root_issues\" ? { ...s, issueIds: s.issueIds.slice(0, 25) } : s);\n    return updatePaperclipIngestionProfile(ctx, { companyId, spaceSlug, profile });\n  }\n  throw err;\n}","preventionTips":["Cap root-issue pickers at 25.","Use selected_projects or company_all for broader coverage.","Split into separate spaces if you need more root issues."],"tags":["validation","ingestion","wiki","limits","paperclip"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}