Skip to content

Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.

fix(plugins): forward recall URI exclusions in Claude and Codex hooks (#5407)

Evoee010f838a19
diff --git a/examples/claude-code-memory-plugin/.claude-plugin/plugin.json b/examples/claude-code-memory-plugin/.claude-plugin/plugin.json
index c4a74c4e1..5972cab6e 100644
--- a/examples/claude-code-memory-plugin/.claude-plugin/plugin.json
+++ b/examples/claude-code-memory-plugin/.claude-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "openviking-memory",
- "version": "0.6.4",
+ "version": "0.6.5",
"description": "Long-term semantic memory for Claude Code, powered by OpenViking. Auto-recall relevant memories at session start and capture important information during conversations.",
"author": {
"name": "OpenViking",
diff --git a/examples/claude-code-memory-plugin/package.json b/examples/claude-code-memory-plugin/package.json
index 268a557fb..91d9d4ae3 100644
--- a/examples/claude-code-memory-plugin/package.json
+++ b/examples/claude-code-memory-plugin/package.json
@@ -1,6 +1,6 @@
{
"name": "claude-code-openviking-memory",
- "version": "0.6.4",
+ "version": "0.6.5",
"description": "OpenViking memory plugin for Claude Code — semantic long-term memory",
"type": "module",
"scripts": {
diff --git a/examples/claude-code-memory-plugin/scripts/auto-recall.mjs b/examples/claude-code-memory-plugin/scripts/auto-recall.mjs
index efb0a3e20..e2aeda355 100644
--- a/examples/claude-code-memory-plugin/scripts/auto-recall.mjs
+++ b/examples/claude-code-memory-plugin/scripts/auto-recall.mjs
@@ -49,6 +49,7 @@ async function recall(cfg, query, peer, sessionId) {
log,
runCompressor,
localCompressorAvailable: Boolean(runCompressor),
+ excludeUris: cfg.recallExcludeUris,
});
}
diff --git a/examples/claude-code-memory-plugin/scripts/auto-recall.test.mjs b/examples/claude-code-memory-plugin/scripts/auto-recall.test.mjs
index 017321712..c199e24f9 100644
--- a/examples/claude-code-memory-plugin/scripts/auto-recall.test.mjs
+++ b/examples/claude-code-memory-plugin/scripts/auto-recall.test.mjs
@@ -7,6 +7,8 @@ import { dirname, join } from "node:path";
import test from "node:test";
import { fileURLToPath } from "node:url";
+import { readRequestBody } from "../../memory-plugin-shared/testing/support.mjs";
+
const SCRIPT_DIR = dirname(fileURLToPath(import.meta.url));
const PLUGIN_DIR = dirname(SCRIPT_DIR);
const SESSION_ID = "recall-branch-session";
@@ -308,3 +310,25 @@ test("the plugin keeps no ranking or transcript copy of its own", async () => {
assert.deepEqual(hits, []);
});
+
+for (const excludeUris of ["", "viking://user/default/skills, viking://agent/skills"]) {
+ test(`context recall forwards configured subtree exclusions ${JSON.stringify(excludeUris)}`, async () => {
+ const requests = [];
+ const { stdout, state } = await recallTurn({
+ env: { OPENVIKING_RECALL_EXCLUDE_URIS: excludeUris },
+ routes: {
+ ...HEALTHY,
+ "POST /api/v1/search/search": async (req) => {
+ requests.push(await readRequestBody(req));
+ return { body: { status: "ok", result: { rendered: "", entries: [], stats: {} } } };
+ },
+ },
+ });
+ assert.equal(requests.length, 1);
+ assert.equal(requests[0].mode, "context");
+ assert.deepEqual(requests[0].exclude_uris, excludeUris
+ ? ["viking://user/default/skills", "viking://agent/skills"] : undefined);
+ assert.equal(state.reason, "no_results");
+ assert.equal(injectedContext(stdout), null);
+ });
+}
diff --git a/examples/codex-memory-plugin/.codex-plugin/plugin.json b/examples/codex-memory-plugin/.codex-plugin/plugin.json
index 27a5da640..da41bfb93 100644
--- a/examples/codex-memory-plugin/.codex-plugin/plugin.json
+++ b/examples/codex-memory-plugin/.codex-plugin/plugin.json
@@ -1,6 +1,6 @@
{
"name": "openviking-memory",
- "version": "0.10.5",
+ "version": "0.10.6",
"description": "Long-term semantic memory for Codex, powered by OpenViking. Recall on UserPromptSubmit, incremental add_message on Stop (per turn), commit on SessionEnd (Codex >= 0.145) and on PreCompact, with an idle/ended sweep on SessionStart as the fallback for signals, crashes and older Codex builds. Includes a local stdio MCP proxy that reads OpenViking credentials from env/ovcli.conf.",
"author": {
"name": "OpenViking",
diff --git a/examples/codex-memory-plugin/scripts/auto-recall.mjs b/examples/codex-memory-plugin/scripts/auto-recall.mjs
index 909a5b203..ab386cb21 100644
--- a/examples/codex-memory-plugin/scripts/auto-recall.mjs
+++ b/examples/codex-memory-plugin/scripts/auto-recall.mjs
@@ -143,6 +143,7 @@ runHookStage({
actorPeerId: effectivePeer.peerId, legacyPeerId: effectivePeer.legacyPeerId,
sessionId: recallSessionId || "", runCompressor,
localCompressorAvailable: Boolean(runCompressor),
+ excludeUris: cfg.recallExcludeUris,
digestCachePath: RECALL_DIGEST_CACHE_PATH, log,
});
log("recall_complete", { stage: recalled.stage, chars: recalled.block.length });
diff --git a/examples/codex-memory-plugin/scripts/auto-recall.test.mjs b/examples/codex-memory-plugin/scripts/auto-recall.test.mjs
index ea9a6f61f..34e9755a0 100644
--- a/examples/codex-memory-plugin/scripts/auto-recall.test.mjs
+++ b/examples/codex-memory-plugin/scripts/auto-recall.test.mjs
@@ -191,7 +191,7 @@ async function runEndpointCompressionCase({
}
}
-test("auto-recall asks the context face with the derived OpenViking session id", async () => {
+async function contextRecallCase(excludeUris) {
const stateDir = await mkdtemp(join(tmpdir(), "ov-auto-recall-state-"));
const requests = [];
@@ -235,6 +235,7 @@ test("auto-recall asks the context face with the derived OpenViking session id",
OPENVIKING_CLI_CONFIG_FILE: join(stateDir, "missing-ovcli.conf"),
OPENVIKING_CREDENTIAL_SOURCE: "env",
OPENVIKING_RECALL_COMPRESS: "0",
+ OPENVIKING_RECALL_EXCLUDE_URIS: excludeUris,
OPENVIKING_RECALL_LIMIT: "1",
OPENVIKING_RECALL_MAX_TOKENS: "800",
OPENVIKING_RECALL_TIMEOUT_MS: "10000",
@@ -254,6 +255,8 @@ test("auto-recall asks the context face with the derived OpenViking session id",
assert.equal(requests.length, 1);
assert.equal(requests[0].body.mode, "context");
+ assert.deepEqual(requests[0].body.exclude_uris, excludeUris
+ ? ["viking://user/default/skills", "viking://agent/skills"] : undefined);
assert.equal(requests[0].body.session_id, "cx-codex_123");
assert.equal(requests[0].body.purpose, "coding");
assert.equal(requests[0].body.limit, undefined);
@@ -267,7 +270,12 @@ test("auto-recall asks the context face with the derived OpenViking session id",
} finally {
await rm(stateDir, { recursive: true, force: true });
}
-});
+}
+
+for (const excludeUris of ["", "viking://user/default/skills, viking://agent/skills"]) {
+ test(`auto-recall asks the context face with session identity and exclusions ${JSON.stringify(excludeUris)}`,
+ () => contextRecallCase(excludeUris));
+}
test("auto-recall prefers the server recall endpoint when available", async () => {
const stateDir = await mkdtemp(join(tmpdir(), "ov-auto-recall-endpoint-"));