paperclipai/paperclip · error · InvocationScopeDeniedError

INVOCATION_SCOPE_DENIED

INVOCATION_SCOPE_DENIED

Error message

Plugin "${pluginId}" is not allowed to perform "${method}": the worker referenced a missing, expired, or unknown invocation scope

What it means

Error "Plugin "${pluginId}" is not allowed to perform "${method}": the worker referenced a missing, expired, or unknown invocation scope" thrown in paperclipai/paperclip.

Source

Thrown at packages/plugins/sdk/src/host-client-factory.ts:603

    if (method === "events.subscribe" && isRecord(params.filter)) {
      const filterCompanyId = readNonEmptyString(params.filter.companyId);
      if (filterCompanyId) return { kind: "single", companyId: filterCompanyId };
    }

    return noCompanyScope;
  }

  function requireInvocationCompanyScope(
    method: WorkerToHostMethodName,
    params: unknown,
    context?: WorkerHostCallContext,
  ): void {
    const requested = requestedCompanyScope(method, params);
    if (requested.kind === "none") return;

    if (context?.invalidInvocationScope) {
      throw new InvocationScopeDeniedError(
        pluginId,
        method,
        "the worker referenced a missing, expired, or unknown invocation scope",
      );
    }

    const allowedCompanyId = readNonEmptyString(context?.invocationScope?.companyId);

    if (requested.kind === "all") {
      if (method === "companies.list") return;
      if (!allowedCompanyId) {
        throw new InvocationScopeDeniedError(pluginId, method, "company context is required");
      }
      throw new InvocationScopeDeniedError(
        pluginId,
        method,
        `the current invocation is scoped to company "${allowedCompanyId}"`,
      );

View on GitHub (pinned to 120ae5428f)

Solutions

  1. Retry the operation so a fresh invocation scope is issued; if persistent, re-invoke the worker from the host.

When it happens

Trigger: Thrown at packages/plugins/sdk/src/host-client-factory.ts:603 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/b3c130a0a58e9129. Report an issue: GitHub.