{"record":{"id":"b3c130a0a58e9129","repo":"paperclipai/paperclip","slug":"invocation-scope-denied","errorCode":"INVOCATION_SCOPE_DENIED","errorMessage":"Plugin \"${pluginId}\" is not allowed to perform \"${method}\": the worker referenced a missing, expired, or unknown invocation scope","messagePattern":"Plugin \"(.+?)\" is not allowed to perform \"(.+?)\": the worker referenced a missing, expired, or unknown invocation scope","errorType":"error_code","errorClass":"InvocationScopeDeniedError","httpStatus":null,"severity":"error","filePath":"packages/plugins/sdk/src/host-client-factory.ts","lineNumber":603,"sourceCode":"\n    if (method === \"events.subscribe\" && isRecord(params.filter)) {\n      const filterCompanyId = readNonEmptyString(params.filter.companyId);\n      if (filterCompanyId) return { kind: \"single\", companyId: filterCompanyId };\n    }\n\n    return noCompanyScope;\n  }\n\n  function requireInvocationCompanyScope(\n    method: WorkerToHostMethodName,\n    params: unknown,\n    context?: WorkerHostCallContext,\n  ): void {\n    const requested = requestedCompanyScope(method, params);\n    if (requested.kind === \"none\") return;\n\n    if (context?.invalidInvocationScope) {\n      throw new InvocationScopeDeniedError(\n        pluginId,\n        method,\n        \"the worker referenced a missing, expired, or unknown invocation scope\",\n      );\n    }\n\n    const allowedCompanyId = readNonEmptyString(context?.invocationScope?.companyId);\n\n    if (requested.kind === \"all\") {\n      if (method === \"companies.list\") return;\n      if (!allowedCompanyId) {\n        throw new InvocationScopeDeniedError(pluginId, method, \"company context is required\");\n      }\n      throw new InvocationScopeDeniedError(\n        pluginId,\n        method,\n        `the current invocation is scoped to company \"${allowedCompanyId}\"`,\n      );","sourceCodeStart":585,"sourceCodeEnd":621,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/packages/plugins/sdk/src/host-client-factory.ts#L585-L621","documentation":"Error \"Plugin \"${pluginId}\" is not allowed to perform \"${method}\": the worker referenced a missing, expired, or unknown invocation scope\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at packages/plugins/sdk/src/host-client-factory.ts:603 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Retry the operation so a fresh invocation scope is issued; if persistent, re-invoke the worker from the host."],"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-14T05:17:10.506Z"}