{"record":{"id":"6fc7542c39743916","repo":"paperclipai/paperclip","slug":"approval-params-approvalid-not-found","errorCode":null,"errorMessage":"Approval \"${params.approvalId}\" not found","messagePattern":"Approval \"(.+?)\" not found","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-host-services.ts","lineNumber":2662,"sourceCode":"        await ensurePluginAvailableForCompany(companyId);\n        const rows = await approvalSvc.list(companyId, params.status ?? undefined);\n        // Match the web app's approval read surface: payloads are redacted so\n        // the chat bridge never receives secrets the web app itself hides.\n        return rows.map((approval) => redactApprovalPayload(approval)) as any;\n      },\n      async get(params) {\n        const companyId = ensureCompanyId(params.companyId);\n        await ensurePluginAvailableForCompany(companyId);\n        const approval = await approvalSvc.getById(params.approvalId);\n        if (!approval || approval.companyId !== companyId) return null;\n        return redactApprovalPayload(approval) as any;\n      },\n      async decide(params) {\n        const companyId = ensureCompanyId(params.companyId);\n        await ensurePluginAvailableForCompany(companyId);\n        const existing = await approvalSvc.getById(params.approvalId);\n        if (!existing || existing.companyId !== companyId) {\n          throw new Error(`Approval \"${params.approvalId}\" not found`);\n        }\n        // Deciding an approval is a board-user action (the web app's approval\n        // decision routes are board-only). Re-verify active membership at apply\n        // time; never trust the plugin-supplied identity.\n        if (!params.actorUserId) {\n          throw new Error(\"actorUserId is required to decide an approval on behalf of a board user\");\n        }\n        await requireActiveHumanMember(companyId, params.actorUserId);\n\n        const { approval, applied } = params.action === \"approve\"\n          ? await approvalSvc.approve(params.approvalId, params.actorUserId, params.decisionNote ?? null)\n          : await approvalSvc.reject(params.approvalId, params.actorUserId, params.decisionNote ?? null);\n\n        await logPluginActivity({\n          companyId,\n          action: params.action === \"approve\" ? \"approval.approved\" : \"approval.rejected\",\n          entityType: \"approval\",\n          entityId: approval.id,","sourceCodeStart":2644,"sourceCodeEnd":2680,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/plugin-host-services.ts#L2644-L2680","documentation":"The approvals API get() lookup found no approval with the given approvalId. The plugin referenced an approval that does not exist (bad id or already purged).","triggerScenarios":"Thrown at server/src/services/plugin-host-services.ts:2653 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Confirm the approvalId exists for this company; list pending approvals and use a current ID — the approval may have been resolved or deleted."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}