JuliusBrussee/caveman · error

cave_memory_consent_unsupported

cave_memory_consent_unsupported

Error message

cave_memory_consent_unsupported: only "local_only" consent is supported

What it means

The memory() primitive only supports local, single-tenant memory, so options.consent must be "local_only" (the default when omitted). Values like "project_shared" describe a shared-backend consent contract this package does not provide. Like the provenance check, this is validated at construction time to fail closed before any model turn is spent.

Solutions

  1. Remove the consent option entirely — "local_only" is the default and the only supported value
  2. Set consent: "local_only" explicitly if the definition is generated programmatically
  3. If project_shared consent is required, move to the backend/package that implements shared memory
  4. Fix casing/typos so the value is exactly "local_only"

Example fix

// before
defineMemory({ namespace: "notes", ttl: "7d", consent: "project_shared" });
// after
defineMemory({ namespace: "notes", ttl: "7d" }); // consent defaults to "local_only"
Defensive patterns

Strategy: validation

Validate before calling

function isSupportedConsent(c) {
  return c === undefined || c === "local_only";
}
// before calling: if (!isSupportedConsent(consent)) throw new Error(`unsupported consent: ${consent}`);

Type guard

function isLocalOnlyConsent(c: unknown): c is "local_only" | undefined {
  return c === undefined || c === "local_only";
}

Try / catch

try {
  const def = memory({ namespace: "notes", consent });
} catch (err) {
  if (err instanceof Error && err.message.includes("cave_memory_consent_unsupported")) {
    console.error(`Consent ${JSON.stringify(consent)} unsupported here; only "local_only" (default) is available`);
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling memory() with consent: "project_shared" (or any value other than "local_only") in the options object, including typos or differently-cased strings, since the check is a strict equality comparison.

Common situations: Reusing a memory definition written for a shared/collaborative deployment in this local-only package; copying options from documentation of a different edition; a misspelled consent value.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@3ee70a1026 (2026-09-20). Data as JSON: /api/errors/5c7dd19a4098903f. Report an issue: GitHub.

Appendix: source

Thrown at packages/agent/src/primitives.ts:290

    throw new Error("caveman agent: memory recallBudget must be a non-negative integer");
  }
  try {
    memoryTTLMilliseconds(options.ttl);
  } catch {
    throw new Error("caveman agent: memory ttl must use positive m, h, or d duration");
  }
  // Fail closed at CONSTRUCTION, not at tool-call time: the durable
  // store implements only local, single-tenant memory. A `project`/`external`
  // provenance or a `project_shared` consent is a shared-backend contract this
  // package does not provide, so it is refused here rather than burning a model
  // turn to discover a config the framework already knew was unsupported.
  const provenance = options.provenance ?? "local";
  if (provenance !== "local") {
    throw new Error("cave_memory_provenance_unsupported: only \"local\" memory is supported");
  }
  const consent = options.consent ?? "local_only";
  if (consent !== "local_only") {
    throw new Error("cave_memory_consent_unsupported: only \"local_only\" consent is supported");
  }
  return Object.freeze({
    kind: "memory",
    namespace: options.namespace,
    provenance,
    ttl: options.ttl,
    recallBudget: options.recallBudget,
    consent,
  });
}

export type ContextKind =
  | "instruction"
  | "user_intent"
  | "tool_schema"
  | "skill"
  | "memory"
  | "history"

View on GitHub (pinned to 3ee70a1026)