JuliusBrussee/caveman · error · Error

cave_${harness}_upstream_version_unsupported

cave_${harness}_upstream_version_unsupported

Error message

cave_${harness}_upstream_version_unsupported

What it means

The installed version of the pinned upstream was resolved but differs from the exact pin the adapter enforces (Vercel AI SDK 7.0.43, Eve 0.29.2, Mastra 1.55.0 — exported constants in adapters.ts). The adapter executes only against the exact-pinned version, so any other installed version is rejected at adapter construction.

Solutions

  1. Pin the exact version in dependencies: ai@7.0.43 / eve@0.29.2 / @mastra/core@1.55.0 and reinstall from a clean lockfile
  2. Add a package.json override so no transitive path can bump the pinned package
  3. Re-run install and verify with npm ls ai (or eve / @mastra/core) that a single exact version resolves

Example fix

// package.json — before
"dependencies": { "ai": "^7.0.0" }

// after
"dependencies": { "ai": "7.0.43" }
Defensive patterns

Strategy: validation

Validate before calling

// Before constructing the adapter, compare installed vs pinned versions.
import { createRequire } from "node:module";
function installedVersion(pkg: string): string | undefined {
  try {
    const path = createRequire(import.meta.url).resolve(`${pkg}/package.json`);
    return JSON.parse(readFileSync(path, "utf8")).version;
  } catch {
    return undefined;
  }
}
if (installedVersion("ai") !== VERCEL_AI_SDK_VERSION) {
  throw new Error(`install ai@${VERCEL_AI_SDK_VERSION} exactly`);
}

Try / catch

try {
  const adapter = createEveAdapter(identity, session);
} catch (error) {
  if (error instanceof Error && error.message.endsWith("_upstream_version_unsupported")) {
    // Installed upstream differs from the exact pin; reinstall the pinned
    // version and rebuild the lockfile before retrying.
  }
  throw error;
}

Prevention

When it happens

Trigger: createVercelAISDKAdapter/createEveAdapter/createMastraAdapter while node_modules contains ai != 7.0.43, eve != 0.29.2, or @mastra/core != 1.55.0 — e.g. a caret/tilde range resolved to a newer minor, a lockfile regenerated, or a transitive dependency bumped the package.

Common situations: "ai": "^7.0.0" in package.json drifting to 7.0.44+; a fresh install after a new upstream release; another package in the workspace forcing a different @mastra/core.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@766dce6b13 (2026-08-18). Data as JSON: /api/errors/bb9ef81069920448. Report an issue: GitHub.

Appendix: source

Thrown at packages/agent/src/adapters.ts:589

  }
  return undefined;
}

function assertSupportedUpstream(
  identity: HarnessAdapterIdentity,
  expected: string,
  harness: string,
  pkg: string,
): void {
  // The pin is enforced against the INSTALLED version, and the caller's claimed
  // upstreamVersion must match what is actually installed — a claim alone can no
  // longer authorize execution.
  const installed = installedPackageVersion(pkg);
  if (installed === undefined) {
    throw new Error(`cave_${harness}_upstream_version_unresolvable`);
  }
  if (installed !== expected) {
    throw new Error(`cave_${harness}_upstream_version_unsupported`);
  }
  if (identity.upstreamVersion !== installed) {
    throw new Error(`cave_${harness}_upstream_version_mismatch`);
  }
}

function canonicalRecord(value: Readonly<Record<string, unknown>>): Readonly<Record<string, unknown>> {
  let encoded: string;
  try {
    encoded = stableStringify(value);
  } catch {
    throw new Error("cave_harness_wire_contract_invalid");
  }
  const decoded = JSON.parse(encoded) as unknown;
  if (!isRecord(decoded)) throw new Error("cave_harness_wire_contract_invalid");
  return decoded;
}

View on GitHub (pinned to 766dce6b13)