{"record":{"id":"55eca9685b2c3e35","repo":"paperclipai/paperclip","slug":"agentid-is-required","errorCode":null,"errorMessage":"agentId is required","messagePattern":"agentId is required","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-llm-wiki/src/worker.ts","lineNumber":775,"sourceCode":"    ctx.actions.register(\"reconcile-managed-agent\", async (params) => {\n      return reconcileWikiAgentResource(ctx, readCompanyIdFromParams(params));\n    });\n\n    ctx.actions.register(\"reconcile-managed-project\", async (params) => {\n      return reconcileWikiProjectResource(ctx, readCompanyIdFromParams(params));\n    });\n\n    ctx.actions.register(\"reconcile-managed-skills\", async (params) => {\n      return { managedSkills: await reconcileWikiSkillResources(ctx, readCompanyIdFromParams(params)) };\n    });\n\n    ctx.actions.register(\"reset-managed-skills\", async (params) => {\n      return { managedSkills: await resetWikiSkillResources(ctx, readCompanyIdFromParams(params)) };\n    });\n\n    ctx.actions.register(\"select-managed-agent\", async (params) => {\n      const agentId = stringField(params.agentId);\n      if (!agentId) throw new Error(\"agentId is required\");\n      return selectWikiAgentResource(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        agentId,\n      });\n    });\n\n    ctx.actions.register(\"select-managed-project\", async (params) => {\n      const projectId = stringField(params.projectId);\n      if (!projectId) throw new Error(\"projectId is required\");\n      return selectWikiProjectResource(ctx, {\n        companyId: readCompanyIdFromParams(params),\n        projectId,\n      });\n    });\n\n    ctx.actions.register(\"reset-managed-routine\", async (params) => {\n      return ctx.routines.managed.reset(\n        routineKeyField(params.routineKey),","sourceCodeStart":757,"sourceCodeEnd":793,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/packages/plugins/plugin-llm-wiki/src/worker.ts#L757-L793","documentation":"Thrown by the select-managed-agent worker action when params.agentId is missing or blank. The action binds a Wiki Maintainer agent to the company's managed resources; without an agentId there is nothing to select.","triggerScenarios":"Calling select-managed-agent without agentId, with an empty string, or with a whitespace value (stringField returns null).","commonSituations":"Operator forgot to pass the agent id; param keyed 'agent_id'; agent picker UI submitted before selection.","solutions":["Pass a valid agentId that exists for the company.","Verify the agent via ctx.agents.get before calling to avoid the downstream 'could not be loaded' error.","Use camelCase param name (agentId)."],"exampleFix":"// before\nctx.actions.run('select-managed-agent', { companyId });\n// after\nctx.actions.run('select-managed-agent', { companyId, agentId });","handlingStrategy":"validation","validationCode":"function assertAgentId(value: unknown) {\n  if (typeof value !== 'string' || !value.trim()) throw new Error('agentId is required');\n}","typeGuard":"function isNonBlankString(value: unknown): value is string {\n  return typeof value === 'string' && value.trim().length > 0;\n}","tryCatchPattern":null,"preventionTips":["Verify the agent exists with ctx.agents.get before selecting.","Use camelCase param keys (agentId)."],"tags":["paperclip","wiki","agent","validation"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}