{"record":{"id":"1c9dfc678dc6053b","repo":"paperclipai/paperclip","slug":"upgrade-failed-new-manifest-id-newmanifest-id","errorCode":null,"errorMessage":"Upgrade failed: new manifest ID '${newManifest.id}' does not match existing plugin ID '${oldManifest.id}'","messagePattern":"Upgrade failed: new manifest ID '(.+?)' does not match existing plugin ID '(.+?)'","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/plugin-loader.ts","lineNumber":1817,"sourceCode":"\n      log.info(\n        { pluginId, packageName, version, localPath },\n        \"plugin-loader: upgrading plugin\",\n      );\n\n      // 1. Fetch/Install the new version\n      const discovered = await fetchAndValidate({\n        packageName,\n        localPath,\n        version,\n        installDir: localPluginDir,\n      });\n\n      const newManifest = discovered.manifest!;\n\n      // 2. Validate it's the same plugin ID\n      if (newManifest.id !== oldManifest.id) {\n        throw new Error(\n          `Upgrade failed: new manifest ID '${newManifest.id}' does not match existing plugin ID '${oldManifest.id}'`,\n        );\n      }\n\n      // 3. Detect capability escalation — new capabilities not in the old manifest\n      const oldCaps = new Set(oldManifest.capabilities ?? []);\n      const newCaps = newManifest.capabilities ?? [];\n      const escalated = newCaps.filter((c) => !oldCaps.has(c));\n\n      if (escalated.length > 0) {\n        log.warn(\n          { pluginId, escalated, oldVersion: oldManifest.version, newVersion: newManifest.version },\n          \"plugin-loader: upgrade introduces new capabilities — requires admin approval\",\n        );\n        throw new Error(\n          `Upgrade for \"${pluginId}\" introduces new capabilities that require approval: ${escalated.join(\", \")}. ` +\n            `The previous version declared [${[...oldCaps].join(\", \")}]. ` +\n            `Please review and approve the capability escalation before upgrading.`,","sourceCodeStart":1799,"sourceCodeEnd":1835,"githubUrl":"https://github.com/paperclipai/paperclip/blob/120ae5428fa29bee300bcf806491cd4d965fbb7c/server/src/services/plugin-loader.ts#L1799-L1835","documentation":"Upgrade identity guard: the newly fetched manifest's id differs from the currently installed manifest's id. Upgrades must replace the same plugin — a different id would be a new install, not an upgrade; the wrong package/version being upgraded to is at fault.","triggerScenarios":"Thrown at server/src/services/plugin-loader.ts:1817 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The new package is a different plugin (different manifest id). Uninstall the old plugin and install the new one separately, or publish the upgrade under the same id."],"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"}