paperclipai/paperclip · error

ACPX claude package dependency mismatch for

Error message

ACPX claude package dependency mismatch for ${expected.packageName}

What it means

Once a valid dependencies object exists, each entry in QUALIFIED_CLAUDE_PROVIDER_DEPENDENCIES must be declared with the exact string (dependencyDeclaration) recorded at qualification time. This error fires when a qualified package is declared with a different range/version than the qualified manifest, indicating the installed claude package's dependency graph diverged from the qualified baseline.

Solutions

  1. Reinstall the exact qualified claude server package version so its dependency declarations match QUALIFIED_CLAUDE_PROVIDER_DEPENDENCIES byte-for-byte.
  2. Restore the expected dependency declaration string in the server package's package.json to the qualified value.
  3. If you intentionally upgraded, re-run the qualification flow to regenerate QUALIFIED_CLAUDE_PROVIDER_DEPENDENCIES for the new versions (do not bypass the check).
  4. Use a committed lockfile and install with frozen lockfile so resolved declarations stay identical to qualification time.

Example fix

// before (server package.json dependencies)
"@anthropic-ai/claude-code": "^2.0.0"
// after
"@anthropic-ai/claude-code": "2.0.14"
Defensive patterns

Strategy: validation

Validate before calling

for (const expected of QUALIFIED_CLAUDE_PROVIDER_DEPENDENCIES) {
  const actual = serverPackage.dependencies?.[expected.packageName];
  if (actual !== expected.dependencyDeclaration) {
    throw new Error(`pre-check: ${expected.packageName} declared as ${actual}, qualified as ${expected.dependencyDeclaration}`);
  }
}

Type guard

const declarationMatches = (pkg, expected) =>
  pkg?.dependencies?.[expected.packageName] === expected.dependencyDeclaration;

Try / catch

try {
  await verifyQualifiedAcpxInstallation(input);
} catch (e) {
  const m = e.message.match(/dependency mismatch for (.+)$/);
  if (m) {
    await reinstallPackageAt(m[1], qualifiedVersionOf(m[1]));
  } else throw e;
}

Prevention

When it happens

Trigger: verifyQualifiedAcpxInstallation with profile.agent === "claude" where serverPackage.dependencies[expected.packageName] !== expected.dependencyDeclaration for any qualified package — e.g. dependencies lists "^2.0.0" but qualification pinned "2.0.14", or the dependency was removed/renamed.

Common situations: Running npm/pnpm update that rewrote a pinned version to a caret range; upgrading the claude server package to a newer release that bumped a dependency; a lockfile-less install resolving a different version; manually editing package.json.

Understand the failure class

Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.

Related errors


AI-assisted analysis of paperclipai/paperclip@3f1d897a7c (2026-09-10). Data as JSON: /api/errors/22361042f40f9a86. Report an issue: GitHub.

Appendix: source

Thrown at packages/paperclip-runner/src/drivers/acpx/installation-integrity.ts:620

    directory: string;
    format: AcpxCommandFormat;
  }> = [];
  if (profile.agent === "claude") {
    const declaredDependencies = serverPackage.dependencies;
    if (
      typeof declaredDependencies !== "object" ||
      declaredDependencies === null ||
      Array.isArray(declaredDependencies)
    ) {
      throw new Error("ACPX claude package omitted its qualified dependencies");
    }
    for (const expected of QUALIFIED_CLAUDE_PROVIDER_DEPENDENCIES) {
      if (
        (declaredDependencies as Record<string, unknown>)[
          expected.packageName
        ] !== expected.dependencyDeclaration
      ) {
        throw new Error(
          `ACPX claude package dependency mismatch for ${expected.packageName}`,
        );
      }
      const dependencyPackageJsonPath = await realpath(
        resolvePackageJson(expected.packageName, serverPackageJsonPath),
      );
      const dependencyPackage = await readPackageJson(
        dependencyPackageJsonPath,
        expected.packageName,
      );
      if (dependencyPackage.version !== expected.packageVersion) {
        throw new Error(
          `ACPX claude dependency package version mismatch for ${expected.packageName}: expected ${expected.packageVersion}, received ${dependencyPackage.version ?? "unknown"}`,
        );
      }
      supplementalPackages.push({
        directory: dirname(dependencyPackageJsonPath),
        format: packageModuleFormat(dependencyPackage.type),

View on GitHub (pinned to 3f1d897a7c)