Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ jobs:

- name: Build
if: steps.version-check.outputs.changed == 'true'
run: bun run build:lib
run: bun run build:plugin

- name: Publish
if: steps.version-check.outputs.changed == 'true'
Expand Down
15 changes: 12 additions & 3 deletions client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export class SupermemoryClient {
customId?: string,
containerTag?: string,
entityContext?: string,
): Promise<{ id: string }> {
): Promise<{ id: string; status: string }> {
const cleaned = sanitizeContent(content)
const tag = containerTag ?? this.containerTag

Expand All @@ -81,8 +81,17 @@ export class SupermemoryClient {
...(clampedCtx && { entityContext: clampedCtx }),
})

log.debugResponse("add", { id: result.id })
return { id: result.id }
log.debugResponse("add", { id: result.id, status: result.status })

if (result.status === "failed") {
log.warn(
`add returned status="failed" for id=${result.id}` +
(customId ? ` customId=${customId}` : "") +
` (contentLength=${cleaned.length}, containerTag=${tag})`,
)
}

return { id: result.id, status: result.status }
}

async search(
Expand Down
7 changes: 6 additions & 1 deletion commands/slash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function registerCommands(
try {
const category = detectCategory(text)
const sk = getSessionKey()
await client.addMemory(
const { status } = await client.addMemory(
text,
{ type: category, source: "openclaw_command" },
sk ? buildDocumentId(sk) : undefined,
Expand All @@ -61,6 +61,11 @@ export function registerCommands(
)

const preview = text.length > 60 ? `${text.slice(0, 60)}…` : text
if (status === "failed") {
return {
text: `Memory store failed (server returned status="failed") for: "${preview}"`,
}
}
return { text: `Remembered: "${preview}"` }
} catch (err) {
log.error("/remember failed", err)
Expand Down
14 changes: 11 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
{
"name": "@supermemory/openclaw-supermemory",
"version": "2.1.11",
"version": "2.1.12",
"type": "module",
"description": "OpenClaw Supermemory memory plugin",
"license": "MIT",
"files": [
"dist",
"openclaw.plugin.json",
"README.md",
"types"
],
"dependencies": {
"supermemory": "^4.0.0",
"@sinclair/typebox": "0.34.47"
Expand All @@ -12,14 +18,16 @@
"check-types": "tsc --noEmit",
"lint": "bunx @biomejs/biome ci .",
"lint:fix": "bunx @biomejs/biome check --write .",
"build:lib": "esbuild lib/validate.ts --bundle --minify --format=esm --platform=node --target=es2022 --external:node:crypto --outfile=lib/validate.js"
"build:plugin": "esbuild index.ts --bundle --format=esm --platform=node --target=es2022 --external:openclaw --external:openclaw/* --external:supermemory --external:@sinclair/typebox --outfile=dist/index.js",
"build": "bun run build:plugin",
"prepack": "bun run build"
},
"peerDependencies": {
"openclaw": ">=2026.2.17"
},
"openclaw": {
"extensions": [
"./index.ts"
"./dist/index.js"
]
},
"repository": {
Expand Down
13 changes: 12 additions & 1 deletion tools/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export function registerStoreTool(
`store tool: category="${category}" customId="${customId}" containerTag="${params.containerTag ?? "default"}"`,
)

await client.addMemory(
const { status } = await client.addMemory(
params.text,
{ type: category, source: "openclaw_tool" },
customId,
Expand All @@ -55,6 +55,17 @@ export function registerStoreTool(
const preview =
params.text.length > 80 ? `${params.text.slice(0, 80)}…` : params.text

if (status === "failed") {
return {
content: [
{
type: "text" as const,
text: `Memory store failed (server returned status="failed") for: "${preview}"`,
},
],
}
}

return {
content: [{ type: "text" as const, text: `Stored: "${preview}"` }],
}
Expand Down
Loading