Skip to content

Commit 8c19e3d

Browse files
committed
v0.111.2 — openclaw plugin contract fixes, bump script improvement
- Fix stale info.version (was 0.108.0), bump script now replaces all version occurrences in index.ts (count=0) - Add missing estimatedTokens to bootstrap CE assemble return - Accept prompt/model params in assemble (use explicit prompt, fall back to extraction from last user message) - Delegate compact() to runtime instead of no-op (fixes /compact and overflow recovery for non-owning engines) - Fix dead source ternary in memory_search - Fix onSubagentEnded reason type to match SubagentEndReason union - Fix formatTurn test drift (bogus 500-char user limit → maxInlineLength) - Add openclaw/plugin-sdk/* as external in esbuild config
1 parent d431f9c commit 8c19e3d

13 files changed

Lines changed: 258 additions & 43 deletions

File tree

CLAUDE.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,21 @@ If you accidentally stage private content, stop and alert the user before commit
2222

2323
## Release process
2424

25-
1. `python scripts/bump_version.py X.Y.Z`
25+
```bash
26+
scripts/release.sh patch # 0.111.1 → 0.111.2
27+
scripts/release.sh minor # 0.111.1 → 0.112.0
28+
scripts/release.sh 0.112.0 # explicit version
29+
```
30+
31+
The script handles: version bump, commit, tag, build, push, PyPI upload, GitHub release.
32+
33+
- **Patch**: bug fixes, contract alignment, dependency updates. Release notes are the commit body (bullet list).
34+
- **Minor**: new features, behavioral changes. Release notes use `## What's new` with commit log since last minor.
35+
36+
Manual steps (when needed):
37+
1. `python scripts/bump_version.py X.Y.Z` — bump all version strings
2638
2. Commit, tag `vX.Y.Z`, push with `--tags`
27-
3. `python -m build && twine upload dist/keep_skill-X.Y.Z*`
39+
3. `python -m build && uvx twine upload dist/keep_skill-X.Y.Z*`
2840
4. `gh release create vX.Y.Z`
2941

3042
Both `keep-skill` and `langchain-keep` go to PyPI.

SKILL.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
name: keep
3-
version: 0.111.1
3+
version: 0.111.2
44
description: Reflective Memory
55
homepage: https://github.com/keepnotes-ai/keep
66
runtime: python:3.12-slim

claude-code-plugin/.claude-plugin/plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "keep",
3-
"version": "0.111.1",
3+
"version": "0.111.2",
44
"description": "Reflective memory with semantic search for AI agents",
55
"author": {
66
"name": "keepnotes-ai",

keep/data/openclaw-plugin/build.mjs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ await build({
4040
"perf_hooks",
4141
"async_hooks",
4242
"diagnostics_channel",
43+
// OpenClaw plugin SDK — resolved by jiti at runtime
44+
"openclaw/*",
4345
],
4446
// Banner for source identification
4547
banner: {

keep/data/openclaw-plugin/openclaw.plugin.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"id": "keep",
33
"name": "keep",
44
"description": "Reflective memory — context engine + memory tools",
5-
"version": "0.111.1",
5+
"version": "0.111.2",
66
"kind": "context-engine",
77
"configSchema": {
88
"type": "object",

keep/data/openclaw-plugin/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@keepnotes-ai/keep",
3-
"version": "0.111.1",
3+
"version": "0.111.2",
44
"description": "keep — reflective memory plugin for OpenClaw (context engine + memory tools)",
55
"type": "module",
66
"license": "MIT",

keep/data/openclaw-plugin/src/index.test.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,7 @@ function formatTurn(messages: any[], maxInlineLength: number): string {
7676
const text = extractText(msg.content);
7777
if (!text.trim()) continue;
7878

79-
const limit = role === "user" ? 500 : maxInlineLength;
80-
parts.push(`[${role}] ${truncate(text, limit)}`);
79+
parts.push(`[${role}] ${truncate(text, maxInlineLength)}`);
8180
}
8281
return parts.join("\n\n");
8382
}
@@ -295,12 +294,12 @@ describe("formatTurn", () => {
295294
assert.ok(result.includes("[assistant] hi"));
296295
});
297296

298-
it("truncates user messages at 500 chars", () => {
297+
it("truncates user messages at maxInlineLength", () => {
299298
const longContent = "x".repeat(600);
300299
const msgs = [{ role: "user", content: longContent }];
301-
const result = formatTurn(msgs, 2000);
302-
// [user] prefix + 500 chars + ellipsis
303-
assert.ok(result.length < 520);
300+
const result = formatTurn(msgs, 200);
301+
// [user] prefix + 200 chars + ellipsis
302+
assert.ok(result.length < 220);
304303
assert.ok(result.endsWith("…"));
305304
});
306305

keep/data/openclaw-plugin/src/index.ts

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import { execFileSync } from "child_process";
1212
import path from "node:path";
1313
import fs from "node:fs";
14+
import { delegateCompactionToRuntime } from "openclaw/plugin-sdk/core";
1415
import { KeepMcpTransport } from "./mcp-transport.js";
1516

1617
// ---------------------------------------------------------------------------
@@ -170,13 +171,14 @@ function registerBootstrapContextEngine(api: any, mode: "install" | "configure")
170171
info: {
171172
id: "keep",
172173
name: "keep (setup required)",
173-
version: "0.111.1",
174+
version: "0.111.2",
174175
ownsCompaction: false,
175176
},
176177
async assemble(params: { messages: any[]; tokenBudget?: number }) {
177178
return {
178179
messages: params.messages,
179180
systemPromptAddition: message,
181+
estimatedTokens: 0,
180182
};
181183
},
182184
};
@@ -492,10 +494,7 @@ export default function register(api: any) {
492494
const startLine = parseInt(tags._focus_start_line, 10) || 1;
493495
const endLine = parseInt(tags._focus_end_line, 10) || startLine;
494496

495-
// Source: memory for memory/ files
496-
const source = relPath.startsWith("memory/") || relPath === "MEMORY.md"
497-
? "memory"
498-
: "memory";
497+
const source = "memory";
499498

500499
return {
501500
path: relPath,
@@ -626,7 +625,7 @@ export default function register(api: any) {
626625
info: {
627626
id: "keep",
628627
name: "keep reflective memory",
629-
version: "0.108.0",
628+
version: "0.111.2",
630629
ownsCompaction: false,
631630
},
632631

@@ -771,6 +770,8 @@ export default function register(api: any) {
771770
sessionKey?: string;
772771
messages: any[];
773772
tokenBudget?: number;
773+
model?: string;
774+
prompt?: string;
774775
}) {
775776
const conversationTokens = params.messages.reduce((sum: number, m: any) => {
776777
return sum + estimateTokens(extractText(m.content));
@@ -788,12 +789,11 @@ export default function register(api: any) {
788789
try {
789790
const cfg = getConfig();
790791

791-
const lastUser = [...params.messages]
792-
.reverse()
793-
.find((m: any) => m.role === "user");
794-
const prompt = lastUser
795-
? truncate(extractText(lastUser.content), 500)
796-
: "";
792+
const prompt = params.prompt
793+
?? (() => {
794+
const lastUser = [...params.messages].reverse().find((m: any) => m.role === "user");
795+
return lastUser ? truncate(extractText(lastUser.content), 500) : "";
796+
})();
797797

798798
const totalBudget = params.tokenBudget || 8000;
799799
const keepBudget = Math.floor(totalBudget * cfg.contextBudgetRatio);
@@ -930,7 +930,7 @@ export default function register(api: any) {
930930
},
931931

932932
// -------------------------------------------------------------------
933-
// compact: advisory (ownsCompaction=false)
933+
// compact: delegate to runtime (ownsCompaction=false)
934934
// -------------------------------------------------------------------
935935
async compact(params: {
936936
sessionId: string;
@@ -943,15 +943,13 @@ export default function register(api: any) {
943943
customInstructions?: string;
944944
runtimeContext?: Record<string, unknown>;
945945
}) {
946-
if (params.currentTokenCount) {
947-
api.logger?.debug(
948-
`[keep] compact advisory: ${params.currentTokenCount} tokens, ` +
949-
`target=${params.compactionTarget || "budget"}, ` +
950-
`budget=${params.tokenBudget}`,
951-
);
952-
}
946+
api.logger?.debug(
947+
`[keep] compact: delegating to runtime (tokens=${params.currentTokenCount}, ` +
948+
`target=${params.compactionTarget || "budget"}, ` +
949+
`budget=${params.tokenBudget})`,
950+
);
953951

954-
return { ok: true, compacted: false, reason: "advisory" };
952+
return delegateCompactionToRuntime(params);
955953
},
956954

957955
// -------------------------------------------------------------------
@@ -1015,7 +1013,7 @@ export default function register(api: any) {
10151013
// -------------------------------------------------------------------
10161014
async onSubagentEnded(params: {
10171015
childSessionKey: string;
1018-
reason: string;
1016+
reason: "deleted" | "completed" | "swept" | "released";
10191017
}) {
10201018
sessionFirstAssemble.delete(params.childSessionKey);
10211019
api.logger?.debug(

keep/data/openclaw-plugin/src/mcp-transport.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ export class KeepMcpTransport {
144144
});
145145

146146
this.client = new Client(
147-
{ name: "keep-openclaw-plugin", version: "0.111.1" },
147+
{ name: "keep-openclaw-plugin", version: "0.111.2" },
148148
{ capabilities: {} },
149149
);
150150

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "keep-skill"
7-
version = "0.111.1"
7+
version = "0.111.2"
88
description = "Reflective memory - remember and search documents by meaning"
99
readme = "README.md"
1010
requires-python = ">=3.11,<3.14"

0 commit comments

Comments
 (0)