Skip to content
Merged
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 openclaw/openclaw.plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "evermind-ai-everos",
"name": "OpenClaw Memory — EverOS",
"description": "EverOS-backed cross-session memory for OpenClaw (memory slot).",
"version": "3.0.3",
"version": "3.0.4",
"kind": "memory",
"activation": {
"onStartup": true
Expand Down
4 changes: 2 additions & 2 deletions openclaw/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion openclaw/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@everos-ai/openclaw-plugin",
"version": "3.0.3",
"version": "3.0.4",
"description": "OpenClaw Memory — EverOS: native memory-slot plugin backed by the local EverOS framework.",
"keywords": [
"openclaw",
Expand Down
20 changes: 14 additions & 6 deletions openclaw/src/handlers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -752,12 +752,20 @@ export function createHandlers(deps: HandlerDeps): Handlers {
const project_id = projectIdFrom(ctx);
noteActiveSession(sessionIdOf(ctx), project_id);

// The current user prompt lives in `event.prompt`; `event.messages` is
// prior history (empty on a fresh session, verified against the OpenClaw
// runtime — it never contains the current turn). The query keeps the prompt
// whole and blends in up to `queryN - 1` prior user lines for follow-up
// context; a blank prompt falls back to recent history. See buildRecallQuery.
const current = typeof event.prompt === "string" ? event.prompt : "";
// The current request is `event.currentUserMessage` where the host supplies
// it (2026.11+): `event.prompt` may then carry reconstructed history, and an
// explicit "" means no textual request, which must not fall back to history.
// Older hosts put it in `event.prompt`. `event.messages` is prior history
// (empty on a fresh session; it never contains the current turn). The query
// keeps the request whole and blends in up to `queryN - 1` prior user lines;
// a blank `prompt` falls back to recent history. See buildRecallQuery.
if (event.currentUserMessage === "") return;
const current =
typeof event.currentUserMessage === "string"
? event.currentUserMessage
: typeof event.prompt === "string"
? event.prompt
: "";
const q = buildRecallQuery(current, event.messages ?? [], deps.queryN, deps.queryMaxChars);
if (!q) return; // nothing to recall on
const opts = { timeoutMs: recallTimeoutMs };
Expand Down
5 changes: 5 additions & 0 deletions openclaw/src/openclaw-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,11 @@ export interface PluginHookSessionContext {
export interface BeforePromptBuildEvent {
prompt: string;
messages: unknown[];
/**
* The current request before history projection (OpenClaw 2026.11+). `prompt`
* may carry reconstructed history on some runtimes; `""` means no textual request.
*/
currentUserMessage?: string;
}

/** Honored return fields for `before_prompt_build` (exactly these five). */
Expand Down
26 changes: 26 additions & 0 deletions openclaw/test/handlers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,32 @@ test("recall: uses event.prompt when history is empty (fresh session)", async ()
assert.equal(spy.searches[0]!.query, "what am I working on?");
});

test("recall: currentUserMessage is the query when the host supplies it", async () => {
const spy = spyClient();
const h = createHandlers(baseDeps(spy.client));
await h.recall(
{
prompt: "old turn\nold reply\nwhere is the deploy key?",
messages: [],
currentUserMessage: "where is the deploy key?",
},
ctx(),
);
assert.equal(spy.searches.length, 2);
for (const s of spy.searches) assert.equal(s.query, "where is the deploy key?");
});

test("recall: an explicit empty currentUserMessage recalls nothing, even with history", async () => {
const spy = spyClient();
const h = createHandlers(baseDeps(spy.client));
const out = await h.recall(
{ prompt: "reconstructed", messages: [{ role: "user", content: "earlier question" }], currentUserMessage: "" },
ctx(),
);
assert.equal(out, undefined);
assert.equal(spy.searches.length, 0);
});

test("recall: empty query → no search, no injection", async () => {
const spy = spyClient();
const h = createHandlers(baseDeps(spy.client));
Expand Down