Skip to content

Commit 177ba8b

Browse files
committed
fix: forget mode now correctly deletes memories
1 parent 87b091f commit 177ba8b

3 files changed

Lines changed: 8 additions & 13 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "opencode-supermemory",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "OpenCode plugin that gives coding agents persistent memory using Supermemory",
55
"type": "module",
66
"main": "dist/index.js",

src/index.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -391,18 +391,15 @@ export const SupermemoryPlugin: Plugin = async (ctx: PluginInput) => {
391391
}
392392

393393
const scope = args.scope || "project";
394-
const containerTag =
395-
scope === "user" ? tags.user : tags.project;
396394

397-
const result = await supermemoryClient.forgetMemory(
398-
containerTag,
395+
const result = await supermemoryClient.deleteMemory(
399396
args.memoryId
400397
);
401398

402399
if (!result) {
403400
return JSON.stringify({
404401
success: false,
405-
error: "Failed to forget memory",
402+
error: "Failed to delete memory",
406403
});
407404
}
408405

src/services/client.ts

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -98,17 +98,15 @@ export class SupermemoryClient {
9898
}
9999
}
100100

101-
async forgetMemory(containerTag: string, memoryId?: string) {
101+
async deleteMemory(memoryId: string) {
102102
try {
103-
return await withTimeout(
104-
this.getClient().memories.forget({
105-
containerTag,
106-
id: memoryId,
107-
}),
103+
await withTimeout(
104+
this.getClient().memories.delete(memoryId),
108105
TIMEOUT_MS
109106
);
107+
return { success: true };
110108
} catch (error) {
111-
console.error("Supermemory: forget memory failed", error);
109+
console.error("Supermemory: delete memory failed", error);
112110
return null;
113111
}
114112
}

0 commit comments

Comments
 (0)