{"record":{"id":"5c7dd19a4098903f","repo":"JuliusBrussee/caveman","slug":"cave-memory-consent-unsupported","errorCode":"cave_memory_consent_unsupported","errorMessage":"cave_memory_consent_unsupported: only \"local_only\" consent is supported","messagePattern":"cave_memory_consent_unsupported: only \"local_only\" consent is supported","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/agent/src/primitives.ts","lineNumber":290,"sourceCode":"    throw new Error(\"caveman agent: memory recallBudget must be a non-negative integer\");\n  }\n  try {\n    memoryTTLMilliseconds(options.ttl);\n  } catch {\n    throw new Error(\"caveman agent: memory ttl must use positive m, h, or d duration\");\n  }\n  // Fail closed at CONSTRUCTION, not at tool-call time: the durable\n  // store implements only local, single-tenant memory. A `project`/`external`\n  // provenance or a `project_shared` consent is a shared-backend contract this\n  // package does not provide, so it is refused here rather than burning a model\n  // turn to discover a config the framework already knew was unsupported.\n  const provenance = options.provenance ?? \"local\";\n  if (provenance !== \"local\") {\n    throw new Error(\"cave_memory_provenance_unsupported: only \\\"local\\\" memory is supported\");\n  }\n  const consent = options.consent ?? \"local_only\";\n  if (consent !== \"local_only\") {\n    throw new Error(\"cave_memory_consent_unsupported: only \\\"local_only\\\" consent is supported\");\n  }\n  return Object.freeze({\n    kind: \"memory\",\n    namespace: options.namespace,\n    provenance,\n    ttl: options.ttl,\n    recallBudget: options.recallBudget,\n    consent,\n  });\n}\n\nexport type ContextKind =\n  | \"instruction\"\n  | \"user_intent\"\n  | \"tool_schema\"\n  | \"skill\"\n  | \"memory\"\n  | \"history\"","sourceCodeStart":272,"sourceCodeEnd":308,"githubUrl":"https://github.com/JuliusBrussee/caveman/blob/3ee70a102609e550bd2e68004bf5990a9341c851/packages/agent/src/primitives.ts#L272-L308","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Remove the consent option entirely — \"local_only\" is the default and the only supported value","Set consent: \"local_only\" explicitly if the definition is generated programmatically","If project_shared consent is required, move to the backend/package that implements shared memory","Fix casing/typos so the value is exactly \"local_only\""],"exampleFix":"// before\ndefineMemory({ namespace: \"notes\", ttl: \"7d\", consent: \"project_shared\" });\n// after\ndefineMemory({ namespace: \"notes\", ttl: \"7d\" }); // consent defaults to \"local_only\"","handlingStrategy":"validation","validationCode":"function isSupportedConsent(c) {\n  return c === undefined || c === \"local_only\";\n}\n// before calling: if (!isSupportedConsent(consent)) throw new Error(`unsupported consent: ${consent}`);","typeGuard":"function isLocalOnlyConsent(c: unknown): c is \"local_only\" | undefined {\n  return c === undefined || c === \"local_only\";\n}","tryCatchPattern":"try {\n  const def = memory({ namespace: \"notes\", consent });\n} catch (err) {\n  if (err instanceof Error && err.message.includes(\"cave_memory_consent_unsupported\")) {\n    console.error(`Consent ${JSON.stringify(consent)} unsupported here; only \"local_only\" (default) is available`);\n    return;\n  }\n  throw err;\n}","preventionTips":["Omit consent unless you specifically need it — \"local_only\" is the only supported value","Remove project_shared consent settings when moving configs into this local-only package","Type the options field as 'local_only' | undefined to catch bad values at compile time","Keep shared and local memory templates separate to avoid copy-paste drift"],"tags":["unsupported-feature","configuration","memory","consent"],"backgroundTag":"unsupported-enum-value","analyzedSha":"3ee70a102609e550bd2e68004bf5990a9341c851","analyzedAt":"2026-09-20T15:53:39.229Z","contentChangedAt":"2026-09-20T15:53:39.229Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}