{"record":{"id":"74f47c99d7738e35","repo":"paperclipai/paperclip","slug":"workspaceid-and-companyid-are-required","errorCode":null,"errorMessage":"workspaceId and companyId are required","messagePattern":"workspaceId and companyId are required","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/plugins/plugin-workspace-diff/src/worker.ts","lineNumber":54,"sourceCode":"    : workspaces.find((candidate) => candidate.isPrimary) ?? workspaces[0] ?? null;\n  return projectWorkspace\n    ? resolveDefaultBaseRef({\n      projectWorkspaceDefaultRef: projectWorkspace.defaultRef,\n      projectWorkspaceRepoRef: projectWorkspace.repoRef,\n    })\n    : null;\n}\n\nconst plugin = definePlugin({\n  async setup(ctx) {\n    ctx.logger.info(`${PLUGIN_NAME} plugin setup`);\n    const workspaceDiff = workspaceDiffService();\n\n    ctx.data.register(\"workspace-diff\", async (params: Record<string, unknown>) => {\n      const workspaceId = readString(params.workspaceId);\n      const companyId = readString(params.companyId);\n      if (!workspaceId || !companyId) {\n        throw new Error(\"workspaceId and companyId are required\");\n      }\n\n      if (params.entityType === \"project_workspace\") {\n        const projectId = readString(params.projectId);\n        if (!projectId) {\n          throw new Error(\"projectId is required for project workspace diffs\");\n        }\n        const workspaces = await ctx.projects.listWorkspaces(projectId, companyId);\n        const workspace = workspaces.find((candidate) => candidate.id === workspaceId);\n        if (!workspace) {\n          throw new Error(\"Workspace not found\");\n        }\n        return workspaceDiff.getDiff({\n          id: workspace.id,\n          companyId,\n          cwd: workspace.path,\n          baseRef: resolveDefaultBaseRef({\n            projectWorkspaceDefaultRef: workspace.defaultRef,","sourceCodeStart":36,"sourceCodeEnd":72,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/plugin-workspace-diff/src/worker.ts#L36-L72","documentation":"Error \"workspaceId and companyId are required\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/plugin-workspace-diff/src/worker.ts:54 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass both workspaceId and companyId."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"120ae5428fa29bee300bcf806491cd4d965fbb7c","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}