paperclipai/paperclip · error
agentId is required
Error message
agentId is required
What it means
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.
Source
Thrown at packages/plugins/plugin-llm-wiki/src/worker.ts:775
ctx.actions.register("reconcile-managed-agent", async (params) => {
return reconcileWikiAgentResource(ctx, readCompanyIdFromParams(params));
});
ctx.actions.register("reconcile-managed-project", async (params) => {
return reconcileWikiProjectResource(ctx, readCompanyIdFromParams(params));
});
ctx.actions.register("reconcile-managed-skills", async (params) => {
return { managedSkills: await reconcileWikiSkillResources(ctx, readCompanyIdFromParams(params)) };
});
ctx.actions.register("reset-managed-skills", async (params) => {
return { managedSkills: await resetWikiSkillResources(ctx, readCompanyIdFromParams(params)) };
});
ctx.actions.register("select-managed-agent", async (params) => {
const agentId = stringField(params.agentId);
if (!agentId) throw new Error("agentId is required");
return selectWikiAgentResource(ctx, {
companyId: readCompanyIdFromParams(params),
agentId,
});
});
ctx.actions.register("select-managed-project", async (params) => {
const projectId = stringField(params.projectId);
if (!projectId) throw new Error("projectId is required");
return selectWikiProjectResource(ctx, {
companyId: readCompanyIdFromParams(params),
projectId,
});
});
ctx.actions.register("reset-managed-routine", async (params) => {
return ctx.routines.managed.reset(
routineKeyField(params.routineKey),View on GitHub (pinned to 67001ec6eb)
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).
Example fix
// before
ctx.actions.run('select-managed-agent', { companyId });
// after
ctx.actions.run('select-managed-agent', { companyId, agentId }); Defensive patterns
Strategy: validation
Validate before calling
function assertAgentId(value: unknown) {
if (typeof value !== 'string' || !value.trim()) throw new Error('agentId is required');
} Type guard
function isNonBlankString(value: unknown): value is string {
return typeof value === 'string' && value.trim().length > 0;
} Prevention
- Verify the agent exists with ctx.agents.get before selecting.
- Use camelCase param keys (agentId).
When it happens
Trigger: Calling select-managed-agent without agentId, with an empty string, or with a whitespace value (stringField returns null).
Common situations: Operator forgot to pass the agent id; param keyed 'agent_id'; agent picker UI submitted before selection.
Related errors
- selected_projects exceeds the hard cap of ${MAX_PAPERCLIP_PR
- Project belongs to another company or does not exist: ${proj
- root_issues exceeds the hard cap of ${MAX_PAPERCLIP_PROFILE_
- Issue belongs to another company or does not exist: ${issueI
- Wiki page writes must target AGENTS.md, IDEA.md, or wiki/: $
AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12).
Data as JSON: /api/errors/55eca9685b2c3e35.
Report an issue: GitHub.