paperclipai/paperclip · error · Error
Plugin "${pluginId}" must provide a companyId when emitting
Error message
Plugin "${pluginId}" must provide a companyId when emitting events. What it means
Scope guard in emit: companyId is missing/falsy. Every plugin event must be scoped to a company for routing and tenant isolation, so emitting without one is rejected; the missing companyId argument is at fault.
Source
Thrown at server/src/services/plugin-event-bus.ts:257
},
/**
* Emit a plugin-namespaced event. The event type is automatically
* prefixed with `plugin.<pluginId>.` so:
* - `emit("sync-done", payload)` becomes `"plugin.acme.linear.sync-done"`.
*
* Requires the `events.emit` capability (enforced by the host layer).
*
* @throws {Error} if `name` already contains the `plugin.` prefix
* (prevents cross-namespace spoofing).
*/
async emit(name: string, companyId: string, payload: unknown): Promise<PluginEventBusEmitResult> {
if (!name || name.trim() === "") {
throw new Error(`Plugin "${pluginId}" must provide a non-empty event name.`);
}
if (!companyId || companyId.trim() === "") {
throw new Error(`Plugin "${pluginId}" must provide a companyId when emitting events.`);
}
if (name.startsWith("plugin.")) {
throw new 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.`,
);
}
const eventType = `plugin.${pluginId}.${name}` as const;
const event: PluginEvent = {
eventId: crypto.randomUUID(),
eventType,
companyId,
occurredAt: new Date().toISOString(),
actorType: "plugin",
actorId: pluginId,
payload,View on GitHub (pinned to 120ae5428f)
Solutions
- Include the companyId when emitting plugin events.
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at server/src/services/plugin-event-bus.ts:257 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/8c99c848b1f7c5c3.
Report an issue: GitHub.