{"record":{"id":"6b93a39f26624d61","repo":"paperclipai/paperclip","slug":"no-configured-wiki-maintainer-agent-is-available-f","errorCode":null,"errorMessage":"No configured Wiki Maintainer agent is available for this company.","messagePattern":"No configured Wiki Maintainer agent is available for this company\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/wiki/core.ts","lineNumber":3863,"sourceCode":"    spaceSlug: space.slug,\n    operationType: \"query\",\n    title: input.title ?? `Query LLM Wiki: ${question.slice(0, 72)}`,\n    prompt: question,\n  });\n  const agentId = operation.issue.assigneeAgentId;\n  const channel = queryStreamChannel(operation.operationId);\n\n  if (!agentId) {\n    const warning = \"No configured Wiki Maintainer agent is available for this company.\";\n    await markOperation(ctx, {\n      companyId: input.companyId,\n      operationId: operation.operationId,\n      status: \"blocked\",\n      warning,\n    });\n    await ctx.issues.update(operation.issue.id, { status: \"blocked\" }, input.companyId);\n    await ctx.issues.createComment(operation.issue.id, warning, input.companyId);\n    throw new Error(warning);\n  }\n\n  const agent = await ctx.agents.get(agentId, input.companyId);\n  if (!agent || agent.status === \"paused\" || agent.status === \"terminated\" || agent.status === \"pending_approval\") {\n    const warning = agent\n      ? `Wiki Maintainer agent is not invokable while status is ${agent.status}.`\n      : \"Wiki Maintainer agent could not be loaded.\";\n    await markOperation(ctx, {\n      companyId: input.companyId,\n      operationId: operation.operationId,\n      status: \"blocked\",\n      warning,\n    });\n    await ctx.issues.update(operation.issue.id, { status: \"blocked\" }, input.companyId);\n    await ctx.issues.createComment(operation.issue.id, warning, input.companyId);\n    throw new Error(warning);\n  }\n","sourceCodeStart":3845,"sourceCodeEnd":3881,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/wiki/core.ts#L3845-L3881","documentation":"Thrown when starting a Wiki query operation if no Wiki Maintainer agent is configured for the company (agentId is falsy). The operation is first marked 'blocked', the source issue is set to 'blocked', and a comment is posted before the error surfaces. This makes the failure visible in the issue thread, not just in logs.","triggerScenarios":"Invoking the LLM Wiki query flow (createOperationIssue with operationType 'query', or the underlying operation runner) before the company has selected a Wiki Maintainer agent via the select-managed-agent action.","commonSituations":"Fresh company setup where managed resources were reconciled but no agent selected; the previously-selected agent was deleted/terminated and the selection was not reset; select-managed-agent was skipped during onboarding.","solutions":["Call the select-managed-agent worker action with a valid agentId for the company.","Run reconcile-managed-skills to ensure the Wiki Maintainer skill resource exists, then select an agent that has it.","After fixing, re-open or re-trigger the blocked query operation issue so it transitions out of 'blocked'."],"exampleFix":"// before: query operation with no agent selected -> blocked + thrown error\n// after: select a maintainer agent first\nworker.actions['select-managed-agent']({ companyId, agentId });","handlingStrategy":"validation","validationCode":"async function ensureWikiMaintainer(ctx: PluginContext, companyId: string) {\n  const sel = await getWikiAgentSelection(ctx, companyId);\n  if (!sel?.agentId) throw new Error('Select a Wiki Maintainer agent before running queries');\n  return sel.agentId;\n}","typeGuard":null,"tryCatchPattern":"try {\n  await runWikiQuery(ctx, input);\n} catch (err) {\n  if (err instanceof Error && /No configured Wiki Maintainer agent/.test(err.message)) {\n    await worker.actions['select-managed-agent']({ companyId, agentId });\n    // re-trigger the blocked operation issue\n  } else throw err;\n}","preventionTips":["Run select-managed-agent during company onboarding before any query.","Reconcile managed skills/resources after agent changes."],"tags":["paperclip","wiki","agent","config"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}