JuliusBrussee/caveman · error · Error

cave_memory_consent_unsupported: only "local_only" consent i

Error message

cave_memory_consent_unsupported: only "local_only" consent is supported

What it means

Companion to the provenance guard: the memory store is local and single-tenant, so memory() fails closed at construction when consent is 'project_shared'. Only the default 'local_only' is accepted, because a shared-consent contract implies a shared backend this package does not provide.

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 27d5a3981a)

Solutions

  1. Remove the consent option or set it to 'local_only'
  2. If the intent was to document data sensitivity, record it in your own metadata — the framework has no shared path to consent to
  3. Validate loaded config and delete/deny consent: 'project_shared' before building the agent

Example fix

// before
memory({ namespace: 'notes', ttl: '7d', recallBudget: 10, consent: 'project_shared' });

// after
memory({ namespace: 'notes', ttl: '7d', recallBudget: 10, consent: 'local_only' });
Defensive patterns

Strategy: validation

Validate before calling

const SUPPORTED_CONSENT = new Set(['local_only']);
function checkConsent(c: unknown): 'local_only' | undefined {
  if (c === undefined) return undefined;
  if (!SUPPORTED_CONSENT.has(c as string)) throw new Error('only consent "local_only" is supported by this build');
  return 'local_only';
}

Type guard

function isSupportedConsent(value: unknown): value is 'local_only' { return value === 'local_only' || value === undefined; }

Try / catch

try { memory(opts); } catch (e) { if (e instanceof Error && e.message.startsWith('cave_memory_consent_unsupported')) throw new ConfigError('project_shared consent is not available; use local_only', { cause: e }); throw e; }

Prevention

When it happens

Trigger: Calling memory({ consent: 'project_shared' }) on any namespace. Omitting consent is fine — it defaults to 'local_only'.

Common situations: Spec-driven config written against the full MemoryDefinition type union before checking runtime support; migrating from a team memory tool that required explicit consent flags.

Related errors


AI-assisted analysis of JuliusBrussee/caveman@27d5a3981a (2026-08-15). Data as JSON: /api/errors/34b2837b6f625aff. Report an issue: GitHub.