paperclipai/paperclip · error

projectId is required

Error message

projectId is required

What it means

Thrown by the select-managed-project worker action when params.projectId is missing or blank. The action binds a project to the company's managed wiki resources; without a projectId there is nothing to select.

Source

Thrown at packages/plugins/plugin-llm-wiki/src/worker.ts:784

      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),
        readCompanyIdFromParams(params),
        routineOverridesFromParams(params),
      );
    });

    ctx.actions.register("reconcile-managed-routine", async (params) => {
      return ctx.routines.managed.reconcile(
        routineKeyField(params.routineKey),
        readCompanyIdFromParams(params),

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Pass a valid projectId that exists for the company.
  2. Use camelCase param name (projectId).
  3. Verify the project via ctx.projects.get before calling.

Example fix

// before
ctx.actions.run('select-managed-project', { companyId });
// after
ctx.actions.run('select-managed-project', { companyId, projectId });
Defensive patterns

Strategy: validation

Validate before calling

function assertProjectId(value: unknown) {
  if (typeof value !== 'string' || !value.trim()) throw new Error('projectId is required');
}

Type guard

function isNonBlankString(value: unknown): value is string {
  return typeof value === 'string' && value.trim().length > 0;
}

Prevention

When it happens

Trigger: Calling select-managed-project without projectId, with an empty string, or whitespace-only.

Common situations: Operator forgot to pass the project id; param keyed 'project_id'; project picker submitted before selection.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/dbf39bec2376adca. Report an issue: GitHub.