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

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

11 changes: 11 additions & 0 deletions examples/codex-memory-plugin/scripts/shared/config-schema.mjs

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

1 change: 1 addition & 0 deletions examples/dsh-memory-plugin/runtime.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ export class OpenVikingRuntime {
actorPeerId: state.config.peerId,
legacyPeerId: state.config.legacyPeerId,
sessionId: state.ovSessionId,
excludeUris: state.config.recallExcludeUris,
log: (stage, data) => this.log(stage, data),
},
);
Expand Down
47 changes: 47 additions & 0 deletions examples/dsh-memory-plugin/runtime.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,53 @@ test("autoRecall false stops the recall request", async () => {
assert.equal(await runtime.recallMessage({}, [{ role: "user", content: "what did we decide" }]), null);
});

// recall-core reads options.excludeUris, but the DSH runtime built its options
// without it, so nothing a user configured could stop a subtree from being
// recalled: generated directory files came back as ordinary hits.
test("recallExcludeUris reaches the search request", async () => {
const bodies = [];
const runtime = new OpenVikingRuntime({
async fetchJSON(path, init) {
if (/\/search\/search$/.test(path)) bodies.push(JSON.parse(init.body));
return {
ok: true,
result: {
context: "<openviking-context>\nrecalled\n</openviking-context>",
stats: {},
},
};
},
}, { ...config(), recallExcludeUris: ["viking://user/default/skills", "viking://agent/skills"] }, { debug() {} });
runtime.initialize = async () => ({
ready: true,
config: { ...config(), recallExcludeUris: ["viking://user/default/skills", "viking://agent/skills"] },
});

await runtime.recallMessage({}, [{ role: "user", content: "what did we decide" }]);

assert.equal(bodies.length, 1);
assert.deepEqual(bodies[0].exclude_uris, ["viking://user/default/skills", "viking://agent/skills"]);
});

test("recall sends no exclude_uris when recallExcludeUris is unset", async () => {
const bodies = [];
const runtime = new OpenVikingRuntime({
async fetchJSON(path, init) {
if (/\/search\/search$/.test(path)) bodies.push(JSON.parse(init.body));
return {
ok: true,
result: { context: "<openviking-context>\nrecalled\n</openviking-context>", stats: {} },
};
},
}, config(), { debug() {} });
runtime.initialize = async () => ({ ready: true, config: config() });

await runtime.recallMessage({}, [{ role: "user", content: "what did we decide" }]);

assert.equal(bodies.length, 1);
assert.equal("exclude_uris" in bodies[0], false);
});

test("syncTurns false sends nothing: no capture, no commit, no dispose flush, no replay", async () => {
const pendingDir = await mkdtemp(join(tmpdir(), "dsh-memory-sync-off-"));
tempDirs.push(pendingDir);
Expand Down
11 changes: 11 additions & 0 deletions examples/memory-plugin-shared/lib/config-schema.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,17 @@ export const KNOBS = [
{ name: "logRankingDetails", type: "bool", default: false, env: "OPENVIKING_LOG_RANKING_DETAILS", capability: "recall" },
{ name: "recallLedger", type: "bool", default: true, env: "OPENVIKING_RECALL_LEDGER", capability: "recall" },
{ name: "recallQueryFilters", type: "list", default: [], env: "OPENVIKING_RECALL_QUERY_FILTERS", capability: "recall" },
// Subtree URIs the recall search must never return. Without this there is no
// way to keep generated directory files (viking://user/<space>/skills,
// viking://user/<space>/resources, viking://agent/skills) out of the hits:
// they match like ordinary content and carry only boilerplate text.
{
name: "recallExcludeUris",
type: "list",
default: [],
env: "OPENVIKING_RECALL_EXCLUDE_URIS",
capability: "recall",
},

// Digest compression. Claude Code reads this as the tri-state
// off/client/server/auto through `normalizeRewriteMode`; Codex reads the same
Expand Down