{"record":{"id":"0e5bd734491c633e","repo":"paperclipai/paperclip","slug":"acpx-input-profile-agent-runtime-does-not-match","errorCode":null,"errorMessage":"ACPX ${input.profile.agent} runtime does not match its qualified profile","messagePattern":"ACPX (.+?) runtime does not match its qualified profile","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts","lineNumber":849,"sourceCode":"  profile: QualifiedAcpxProfile;\n  runtimePackage: AcpxPackageMetadata;\n  runtimePackageJsonPath: string;\n  resolvePackageJson: AcpxPackageJsonResolver;\n}): Promise<VerifiedAcpxRuntimeExecutable | null> {\n  const qualification =\n    input.profile.agent === \"claude\"\n      ? process.platform === \"darwin\" && (process.arch === \"arm64\" || process.arch === \"x64\")\n        ? QUALIFIED_CLAUDE_DARWIN_RUNTIMES[process.arch]\n        : QUALIFIED_CLAUDE_LINUX_X64_RUNTIME\n      : input.profile.agent === \"codex\"\n        ? QUALIFIED_CODEX_LINUX_X64_RUNTIME\n        : null;\n  if (qualification === null) return null;\n  if (\n    input.profile.agentRuntimePackage !== qualification.runtimePackageName ||\n    input.profile.agentRuntimeVersion !== qualification.runtimePackageVersion\n  ) {\n    throw new Error(\n      `ACPX ${input.profile.agent} runtime does not match its qualified profile`,\n    );\n  }\n  if (!((process.platform === \"linux\" && process.arch === \"x64\")\n    || (input.profile.agent === \"claude\" && process.platform === \"darwin\" && (process.arch === \"arm64\" || process.arch === \"x64\")))) {\n    throw new Error(\n      `ACPX ${input.profile.agent} verified runtime executable is unavailable for ${process.platform} ${process.arch}`,\n    );\n  }\n\n  const optionalDependencies = input.runtimePackage.optionalDependencies;\n  if (\n    typeof optionalDependencies !== \"object\" ||\n    optionalDependencies === null ||\n    Array.isArray(optionalDependencies) ||\n    (optionalDependencies as Record<string, unknown>)[\n      qualification.packageName\n    ] !== qualification.dependencyDeclaration","sourceCodeStart":831,"sourceCodeEnd":867,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts#L831-L867","documentation":"verifyQualifiedRuntimeExecutable resolves a platform-specific runtime qualification and checks it against the profile: the resolved runtime package name and version must equal profile.agentRuntimePackage and profile.agentRuntimeVersion. A mismatch means the qualified runtime binary shipped/resolved for this platform differs from what the profile pinned, so verification refuses to proceed.","triggerScenarios":"verifyQualifiedAcpxInstallation -> verifyQualifiedRuntimeExecutable where the resolved qualification is non-null but qualification.runtimePackageName !== input.profile.agentRuntimePackage or qualification.runtimePackageVersion !== input.profile.agentRuntimeVersion — e.g. the bundled runtime was upgraded independently of the qualified profile.","commonSituations":"Upgrading the runtime dependency (new version in node_modules) without regenerating the qualified profile; multiple platform variants installed and the wrong one resolved; a stale qualified-profile cache referencing an older package name or version; monorepo dependency bumps changing the resolved runtime.","solutions":["Re-run the qualification/installation flow so profile.agentRuntimePackage/Version are regenerated to match the currently resolved runtime.","Align the installed runtime version with the profile: install the exact qualified runtime package version (npm ci / pnpm install --frozen-lockfile).","Clear stale qualified-profile caches and rebuild the profile from the current install.","If a platform-specific variant resolved unexpectedly, check resolvePackageJson resolution order and remove duplicate runtime copies."],"exampleFix":"// before (profile pinned old runtime, node_modules upgraded)\nagentRuntimePackage: \"@zed-industries/claude-code-acp\", agentRuntimeVersion: \"2.0.14\" // installed: 2.1.0\n// after\n$ npm ci   # restore 2.0.14, or re-qualify the profile against 2.1.0","handlingStrategy":"validation","validationCode":"const resolved = JSON.parse(fs.readFileSync(require.resolve(profile.agentRuntimePackage + \"/package.json\"), \"utf8\"));\nif (resolved.version !== profile.agentRuntimeVersion) {\n  throw new Error(`runtime resolved ${resolved.version} but profile pins ${profile.agentRuntimeVersion}; re-qualify or reinstall`);\n}","typeGuard":"const profileMatchesResolved = (profile, qualification) =>\n  qualification !== null &&\n  qualification.runtimePackageName === profile.agentRuntimePackage &&\n  qualification.runtimePackageVersion === profile.agentRuntimeVersion;","tryCatchPattern":"try {\n  await verifyQualifiedAcpxInstallation(input);\n} catch (e) {\n  if (/runtime does not match its qualified profile/.test(e.message)) {\n    execSync(\"npm ci\"); // or regenerate the qualified profile against the installed runtime\n    await verifyQualifiedAcpxInstallation(input);\n  } else throw e;\n}","preventionTips":["Regenerate the qualified profile whenever the runtime dependency version changes.","Use frozen-lockfile installs so resolved runtime versions never drift from qualification.","In monorepos, gate dependency bumps that touch ACPX runtime packages behind re-qualification CI."],"tags":["installation-integrity","acpx","version-mismatch","profile-pinning"],"backgroundTag":"version-mismatch","analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-09-10T03:14:50.855Z","contentChangedAt":"2026-09-10T03:14:50.855Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}