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 examples/agent-hook-plugin/hosts/codebuddy/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openviking-memory",
"version": "0.5.28",
"version": "0.5.29",
"description": "Long-term semantic memory for the CodeBuddy Code CLI, powered by OpenViking. Injects relevant context at session start and on each prompt, and captures the conversation back into OpenViking.",
"author": {
"name": "OpenViking",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "openviking-memory",
"version": "0.5.28",
"version": "0.5.29",
"clients": [
"cursor"
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,14 @@ export function buildIncrementalCapturePlan(turns, state = {}, cfg = {}) {
if (!decision.shouldCapture) continue;
candidates.push({ dedupKey: turnDedupKey(turn), turn, content: decision.text });
}
const toSend = candidates.filter((item) => !acknowledged.has(item.dedupKey));
const seenInBatch = new Set();
const toSend = candidates.filter((item) => {
if (acknowledged.has(item.dedupKey)) return false;
const batchKey = stableHash(item.dedupKey, item.content);
if (seenInBatch.has(batchKey)) return false;
seenInBatch.add(batchKey);
return true;
});
const payloads = toSend.map(({ turn, content }) => ({
role: turn.role,
content,
Expand Down
2 changes: 1 addition & 1 deletion examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "openviking-memory",
"version": "0.5.28",
"version": "0.5.29",
"description": "Long-term semantic memory for Kimi Code CLI, powered by OpenViking.",
"author": {
"name": "OpenViking",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "openviking-memory",
"version": "0.5.28",
"version": "0.5.29",
"clients": [
"kimicode"
],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "openviking-memory",
"version": "0.5.28",
"version": "0.5.29",
"clients": [
"trae",
"trae-cn"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"schemaVersion": 1,
"id": "openviking-memory",
"version": "0.5.28",
"version": "0.5.29",
"clients": [
"zcode"
],
Expand Down
2 changes: 1 addition & 1 deletion examples/agent-hook-plugin/plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "agent-hook-plugin",
"version": "0.5.28",
"version": "0.5.29",
"description": "Long-term semantic memory for Cursor, TRAE, TRAE CN, ZCode, Kimi Code and CodeBuddy Code — powered by OpenViking. Auto-recall relevant memories and capture the conversation as it happens.",
"author": {
"name": "OpenViking",
Expand Down
23 changes: 23 additions & 0 deletions examples/agent-hook-plugin/tests/zcode-capture.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,29 @@ test("successful capture records every dedup key and suppresses repeated Stop",
assert.equal(repeatedPlan.payloads.length, 0);
});

test("capture plan deduplicates identical messages within one rollout batch", () => {
const duplicatePrompt = { role: "user", content: "same prompt", turnId: "turn-001" };
const turnsWithRetries = [
...Array.from({ length: 10 }, () => duplicatePrompt),
...Array.from({ length: 5 }, (_, index) => ({
role: "assistant",
content: `assistant fragment ${index}`,
turnId: "turn-001",
})),
];

const plan = buildZcodeCapturePlan(turnsWithRetries, {});

assert.equal(plan.payloads.length, 6);
assert.deepEqual(plan.payloads.map(({ role, content }) => ({ role, content })), [
{ role: "user", content: "same prompt" },
...Array.from({ length: 5 }, (_, index) => ({
role: "assistant",
content: `assistant fragment ${index}`,
})),
]);
});

test("queued messages are acknowledged like sent messages", () => {
const plan = buildZcodeCapturePlan(turns, {});
const next = applyZcodeCaptureResult({}, plan, {
Expand Down
Loading