{"record":{"id":"fd8b75212234a5f3","repo":"paperclipai/paperclip","slug":"the-default-llm-wiki-space-cannot-be-archived","errorCode":null,"errorMessage":"The default LLM Wiki space cannot be archived.","messagePattern":"The default LLM Wiki space cannot be archived\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":1472,"sourceCode":"    settings: input.settings ?? {},\n    status: \"active\",\n    createdAt: null,\n    updatedAt: null,\n  };\n  await bootstrapSpaceFiles(ctx, input.companyId, space);\n  await upsertWikiInstance(ctx, { companyId: input.companyId, wikiId });\n  return { status: \"created\", space };\n}\n\nexport async function updateSpace(ctx: PluginContext, input: UpdateSpaceInput): Promise<{ status: \"ok\"; space: WikiSpace }> {\n  const nextStatus = input.status ?? null;\n  if (nextStatus !== null && nextStatus !== \"active\" && nextStatus !== \"archived\") {\n    throw new Error(\"LLM Wiki space status must be active or archived.\");\n  }\n  const space = nextStatus === \"active\" ? await resolveSpaceAnyStatus(ctx, input) : await resolveSpace(ctx, input);\n  const nextDisplayName = stringField(input.displayName);\n  if (space.slug === DEFAULT_SPACE_SLUG && nextStatus === \"archived\") {\n    throw new Error(\"The default LLM Wiki space cannot be archived.\");\n  }\n  await ctx.db.execute(\n    `UPDATE ${spaceTable(ctx)}\n        SET display_name = COALESCE($4, display_name),\n            settings = CASE WHEN $5::jsonb IS NULL THEN settings ELSE settings || $5::jsonb END,\n            status = COALESCE($6, status),\n            updated_at = now()\n      WHERE company_id = $1 AND wiki_id = $2 AND slug = $3`,\n    [\n      input.companyId,\n      space.wikiId,\n      space.slug,\n      nextDisplayName,\n      input.settings ? jsonParam(input.settings) : null,\n      nextStatus ?? null,\n    ],\n  );\n  if (nextStatus === \"archived\") {","sourceCodeStart":1454,"sourceCodeEnd":1490,"githubUrl":"https://github.com/paperclipai/paperclip/blob/5716fe907e596ce73501408fc6efdb19fb61edf2/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L1454-L1490","documentation":"Error \"The default LLM Wiki space cannot be archived.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/plugin-llm-wiki/src/wiki/core.ts:1473 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Do not archive the default wiki space; archive a non-default space instead."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"5716fe907e596ce73501408fc6efdb19fb61edf2","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}