{"record":{"id":"3e023eb9a72256e8","repo":"paperclipai/paperclip","slug":"plugin-pluginid-must-not-include-the-plugin","errorCode":null,"errorMessage":"Plugin \"${pluginId}\" must not include the \"plugin.\" prefix when emitting events. Emit the bare event name (e.g. \"sync-done\") and the bus will namespace it automatically.","messagePattern":"Plugin \"(.+?)\" must not include the \"plugin\\.\" prefix when emitting events\\. Emit the bare event name \\(e\\.g\\. \"sync-done\"\\) and the bus will namespace it automatically\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-event-bus.ts","lineNumber":261,"sourceCode":"       * prefixed with `plugin.<pluginId>.` so:\n       * - `emit(\"sync-done\", payload)` becomes `\"plugin.acme.linear.sync-done\"`.\n       *\n       * Requires the `events.emit` capability (enforced by the host layer).\n       *\n       * @throws {Error} if `name` already contains the `plugin.` prefix\n       *   (prevents cross-namespace spoofing).\n       */\n      async emit(name: string, companyId: string, payload: unknown): Promise<PluginEventBusEmitResult> {\n        if (!name || name.trim() === \"\") {\n          throw new Error(`Plugin \"${pluginId}\" must provide a non-empty event name.`);\n        }\n\n        if (!companyId || companyId.trim() === \"\") {\n          throw new Error(`Plugin \"${pluginId}\" must provide a companyId when emitting events.`);\n        }\n\n        if (name.startsWith(\"plugin.\")) {\n          throw new Error(\n            `Plugin \"${pluginId}\" must not include the \"plugin.\" prefix when emitting events. ` +\n            `Emit the bare event name (e.g. \"sync-done\") and the bus will namespace it automatically.`,\n          );\n        }\n\n        const eventType = `plugin.${pluginId}.${name}` as const;\n        const event: PluginEvent = {\n          eventId: crypto.randomUUID(),\n          eventType,\n          companyId,\n          occurredAt: new Date().toISOString(),\n          actorType: \"plugin\",\n          actorId: pluginId,\n          payload,\n        };\n\n        return emit(event);\n      },","sourceCodeStart":243,"sourceCodeEnd":279,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-event-bus.ts#L243-L279","documentation":"Error \"Plugin \"${pluginId}\" must not include the \"plugin.\" prefix when emitting events. Emit the bare event name (e.g. \"sync-done\") and the bus will namespace it automatically.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at server/src/services/plugin-event-bus.ts:261 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Emit the bare event name (e.g. \"sync-done\") without the \"plugin.\" prefix; the bus namespaces it automatically."],"exampleFix":null,"handlingStrategy":"validation","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-14T00:17:10.932Z"}