paperclipai/paperclip · error

projectId is required for project workspace diffs

Error message

projectId is required for project workspace diffs

What it means

Error "projectId is required for project workspace diffs" thrown in paperclipai/paperclip.

Solutions

  1. Pass projectId when requesting a project workspace diff.

When it happens

Trigger: Thrown at packages/plugins/plugin-workspace-diff/src/worker.ts:60 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@120ae5428f (2026-08-18). Data as JSON: /api/errors/7a00e2b75c576c61. Report an issue: GitHub.

Appendix: source

Thrown at packages/plugins/plugin-workspace-diff/src/worker.ts:60

    : null;
}

const plugin = definePlugin({
  async setup(ctx) {
    ctx.logger.info(`${PLUGIN_NAME} plugin setup`);
    const workspaceDiff = workspaceDiffService();

    ctx.data.register("workspace-diff", async (params: Record<string, unknown>) => {
      const workspaceId = readString(params.workspaceId);
      const companyId = readString(params.companyId);
      if (!workspaceId || !companyId) {
        throw new Error("workspaceId and companyId are required");
      }

      if (params.entityType === "project_workspace") {
        const projectId = readString(params.projectId);
        if (!projectId) {
          throw new Error("projectId is required for project workspace diffs");
        }
        const workspaces = await ctx.projects.listWorkspaces(projectId, companyId);
        const workspace = workspaces.find((candidate) => candidate.id === workspaceId);
        if (!workspace) {
          throw new Error("Workspace not found");
        }
        return workspaceDiff.getDiff({
          id: workspace.id,
          companyId,
          cwd: workspace.path,
          baseRef: resolveDefaultBaseRef({
            projectWorkspaceDefaultRef: workspace.defaultRef,
            projectWorkspaceRepoRef: workspace.repoRef,
          }),
        }, workspaceDiffQuerySchema.parse(params));
      }

      const workspace = await ctx.executionWorkspaces.get(workspaceId, companyId);

View on GitHub (pinned to 120ae5428f)