Component
Other (@mem0/cli — Node/TypeScript CLI)
Description
This is the TypeScript CLI counterpart of #5935 (fixed for the Python CLI in #5936).
PlatformBackend.deleteEntities() in cli/node/src/backend/platform.ts loops over every entity but reassigns a single result variable each pass, so it returns only the last entity's API response:
let result: Record<string, unknown> = {};
for (const [entityType, entityId] of entities) {
result = (await this._request(
"DELETE",
`/v2/entities/${entityType}/${entityId}/`,
{ params: { source: "CLI" } },
)) as Record<string, unknown>;
}
return result;
mem0 entity delete accepts --user-id, --agent-id, --app-id, and --run-id together, and cmd_entities_delete prints this value verbatim via formatJson(result) under --output json (cli/node/src/commands/entities.ts). So a multi-entity delete silently drops every response except the last.
Steps to Reproduce
mem0 entity delete --user-id alice --agent-id bob --force --output json
# JSON shows only the agent deletion; the user deletion response is gone.
Expected Behavior
All deletion responses are returned, keyed by entity type, matching the Python fix in #5936:
{ "user": { ... }, "agent": { ... } }
Actual Behavior
Only the final entity's response is returned; earlier ones are overwritten and lost.
Environment
- @mem0/cli: current
main
- Node: 20
- OS: platform-independent
Component
Other (
@mem0/cli— Node/TypeScript CLI)Description
This is the TypeScript CLI counterpart of #5935 (fixed for the Python CLI in #5936).
PlatformBackend.deleteEntities()incli/node/src/backend/platform.tsloops over every entity but reassigns a singleresultvariable each pass, so it returns only the last entity's API response:mem0 entity deleteaccepts--user-id,--agent-id,--app-id, and--run-idtogether, andcmd_entities_deleteprints this value verbatim viaformatJson(result)under--output json(cli/node/src/commands/entities.ts). So a multi-entity delete silently drops every response except the last.Steps to Reproduce
mem0 entity delete --user-id alice --agent-id bob --force --output json # JSON shows only the agent deletion; the user deletion response is gone.Expected Behavior
All deletion responses are returned, keyed by entity type, matching the Python fix in #5936:
{ "user": { ... }, "agent": { ... } }Actual Behavior
Only the final entity's response is returned; earlier ones are overwritten and lost.
Environment
main