{"record":{"id":"455f462e300c70ec","repo":"mem0ai/mem0","slug":"either-memoryid-or-all-is-required-455f46","errorCode":null,"errorMessage":"Either memoryId or all is required","messagePattern":"Either memoryId or all is required","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"integrations/openclaw/providers.ts","lineNumber":622,"sourceCode":"      if (metadata) {\n        // OSS provider doesn't support metadata-only updates — log warning\n        console.warn(\n          \"providerToBackend: metadata updates are not supported in OSS mode, only text updates are applied\",\n        );\n      }\n      return { id: memoryId, updated: true };\n    },\n\n    async delete(memoryId, opts = {}) {\n      if (opts.all) {\n        await provider.deleteAll(opts.userId ?? userId);\n        return { deleted: \"all\" };\n      }\n      if (memoryId) {\n        await provider.delete(memoryId);\n        return { deleted: memoryId };\n      }\n      throw new Error(\"Either memoryId or all is required\");\n    },\n\n    async deleteEntities() {\n      throw new Error(\"Entity management is only available in platform mode.\");\n    },\n    async status() {\n      return { connected: true, backend: \"oss\" };\n    },\n    async entities() {\n      throw new Error(\"Entity management is only available in platform mode.\");\n    },\n    async listEvents() {\n      throw new Error(\"Event management is only available in platform mode.\");\n    },\n    async getEvent() {\n      throw new Error(\"Event management is only available in platform mode.\");\n    },\n  };","sourceCodeStart":604,"sourceCodeEnd":640,"githubUrl":"https://github.com/mem0ai/mem0/blob/001c235229be8795e3834520467bd0d661ed8f34/integrations/openclaw/providers.ts#L604-L640","documentation":"Thrown by the OSS (open-source) provider's delete() when neither a memoryId nor opts.all was given. In OSS mode deletion goes through the local memory provider; deleting nothing is treated as a caller bug and rejected before touching the vector store. This mirrors the platform backend's equivalent guard.","triggerScenarios":"Calling delete(undefined, {}) on the OSS provider; an agent tool deleting a memory whose id failed to resolve; passing opts.all = false explicitly while memoryId is empty.","commonSituations":"Agent flow: search returns no match, code still calls delete with the undefined id; UI delete button wired without a selected row; migrating from platform mode where delete-all had different semantics.","solutions":["Pass the memory id from the preceding search/list result: delete(memory.id).","For flush-all semantics call delete(undefined, { all: true }) — OSS mode forwards to provider.deleteAll(userId).","Guard upstream: only enable the delete action when an id exists."],"exampleFix":"// before\nif (selected) await provider.delete(selected); // selected can be undefined\n\n// after\nif (selected) await provider.delete(selected);\nelse if (confirmDeleteAll) await provider.delete(undefined, { all: true });\nelse throw new Error('select a memory or confirm delete-all');","handlingStrategy":"validation","validationCode":"if (!memoryId && !opts?.all) {\n  throw new Error('select a memory to delete or pass { all: true }');\n}\nawait provider.delete(memoryId, opts);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Resolve ids via search/get_all before offering delete in agent flows.","Never forward possibly-undefined ids from previous steps into delete()."],"tags":["validation","delete","oss-mode","typescript"],"backgroundTag":null,"analyzedSha":"001c235229be8795e3834520467bd0d661ed8f34","analyzedAt":"2026-08-15T01:55:42.685Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}