diff --git a/examples/agent-hook-plugin/hosts/codebuddy/plugin.json b/examples/agent-hook-plugin/hosts/codebuddy/plugin.json index eabf22e55f2..9e6144a1fb6 100644 --- a/examples/agent-hook-plugin/hosts/codebuddy/plugin.json +++ b/examples/agent-hook-plugin/hosts/codebuddy/plugin.json @@ -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", diff --git a/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json b/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json index 9af7c1e37c6..f55e6122f59 100644 --- a/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json +++ b/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "openviking-memory", - "version": "0.5.28", + "version": "0.5.29", "clients": [ "cursor" ], diff --git a/examples/agent-hook-plugin/hosts/incremental-turn-capture.mjs b/examples/agent-hook-plugin/hosts/incremental-turn-capture.mjs index c8ca0035291..3d75091a5f0 100644 --- a/examples/agent-hook-plugin/hosts/incremental-turn-capture.mjs +++ b/examples/agent-hook-plugin/hosts/incremental-turn-capture.mjs @@ -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, diff --git a/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json b/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json index 7f2715935ea..7f43baf5959 100644 --- a/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json +++ b/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json @@ -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", diff --git a/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json b/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json index 7aafef4ed69..85dd5ee5dd0 100644 --- a/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json +++ b/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "openviking-memory", - "version": "0.5.28", + "version": "0.5.29", "clients": [ "kimicode" ], diff --git a/examples/agent-hook-plugin/hosts/trae/openviking.integration.json b/examples/agent-hook-plugin/hosts/trae/openviking.integration.json index 4535d471436..dd93fce1f61 100644 --- a/examples/agent-hook-plugin/hosts/trae/openviking.integration.json +++ b/examples/agent-hook-plugin/hosts/trae/openviking.integration.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "openviking-memory", - "version": "0.5.28", + "version": "0.5.29", "clients": [ "trae", "trae-cn" diff --git a/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json b/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json index 476f1d97acd..76f972b4133 100644 --- a/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json +++ b/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "openviking-memory", - "version": "0.5.28", + "version": "0.5.29", "clients": [ "zcode" ], diff --git a/examples/agent-hook-plugin/plugin.json b/examples/agent-hook-plugin/plugin.json index 48f8a70aa1d..ba769adf188 100644 --- a/examples/agent-hook-plugin/plugin.json +++ b/examples/agent-hook-plugin/plugin.json @@ -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", diff --git a/examples/agent-hook-plugin/tests/zcode-capture.test.mjs b/examples/agent-hook-plugin/tests/zcode-capture.test.mjs index 35c47697608..53723458ac9 100644 --- a/examples/agent-hook-plugin/tests/zcode-capture.test.mjs +++ b/examples/agent-hook-plugin/tests/zcode-capture.test.mjs @@ -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, {