Skip to content

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

fix(plugin): remove misleading recall top score (#4053)

Yu Zhange2a604167dcf
diff --git a/examples/claude-code-memory-plugin/README.md b/examples/claude-code-memory-plugin/README.md
index 70d7a02f0..db52c0157 100644
--- a/examples/claude-code-memory-plugin/README.md
+++ b/examples/claude-code-memory-plugin/README.md
@@ -270,7 +270,7 @@ The plugin renders a one-line status of OpenViking under your Claude Code input
Examples:
```text
-OV ✓ │ Fable 5 · ctx 42% │ ↩ 6 mem (0.92) · 50ms 6 memories injected; model + context usage
+OV ✓ │ Fable 5 · ctx 42% │ ↩ 6 mem · 50ms 6 memories injected; model + context usage
OV ⚠ slow probe missed the 1 s budget (server may be lagging)
OV ✗ offline server unreachable
OV ⚡ bypass │ Fable 5 · ctx 42% OPENVIKING_BYPASS_SESSION* matched
diff --git a/examples/claude-code-memory-plugin/README_CN.md b/examples/claude-code-memory-plugin/README_CN.md
index f096260e2..fbca1cde5 100644
--- a/examples/claude-code-memory-plugin/README_CN.md
+++ b/examples/claude-code-memory-plugin/README_CN.md
@@ -264,7 +264,7 @@ bypass 命中时所有 hook 直接放行,不联系 OpenViking。
示例:
```text
-OV ✓ │ Fable 5 · ctx 42% │ ↩ 6 mem (0.92) · 50ms 注入 6 条记忆;模型 + 上下文占比
+OV ✓ │ Fable 5 · ctx 42% │ ↩ 6 mem · 50ms 注入 6 条记忆;模型 + 上下文占比
OV ⚠ slow 探针超过 1s 预算(服务器可能在抽风)
OV ✗ offline 服务器不可达
OV ⚡ bypass │ Fable 5 · ctx 42% 命中 OPENVIKING_BYPASS_SESSION*
diff --git a/examples/claude-code-memory-plugin/STATUSLINE.md b/examples/claude-code-memory-plugin/STATUSLINE.md
index 41e7f75f3..42c7f7011 100644
--- a/examples/claude-code-memory-plugin/STATUSLINE.md
+++ b/examples/claude-code-memory-plugin/STATUSLINE.md
@@ -42,7 +42,7 @@ The default composition runs left to right, joined by ` │ `. Segments are cond
| | `OV ✗ offline` | red | probe errored (refused, DNS fail, network down) |
| | `OV ⚡ bypass` | yellow | session matched `OPENVIKING_BYPASS_SESSION` or `*_PATTERNS` |
| Model · ctx | `Fable 5 · ctx 42%` | dim / by usage | always, when CC's statusline payload carries `model` / `context_window`. Registering a custom statusLine replaces CC's native context indicator, so this reproduces it: `<70%` dim, `70–89%` yellow, `≥90%` red (native thresholds). Hide with `OPENVIKING_STATUSLINE_CTX=off`. Shows in bypass mode too — it describes the CC conversation, not OV |
-| Recall | `↩ 6 mem (0.92) · 50ms` | dim | last user prompt actually injected memories. `(0.92)` is the top similarity score among picked items; latency is the recall round-trip |
+| Recall | `↩ 6 mem · 50ms` | dim | last user prompt actually injected memories; latency is the recall round-trip |
| Capture | `✎ 573/20k · 2 arch` | dim | tokens pending toward the next archive (sawtooth — resets on commit), `2 arch` = archives produced this session |
| | `✎ committed · 2 arch` | dim | the turn that just finished produced an archive |
| | `✎ 2 arch` | dim | nothing pending, but archives already exist this session |
@@ -127,7 +127,6 @@ For an assistant adding a segment that consumes existing state. All files live u
{
"reason": "ok" | "bypass" | "offline" | "no_results" | "filtered_out" | "short_query" | ...,
"count": 6, // memories actually injected
- "top_score": 0.92, // max score among picked items
"latency_ms": 180,
"cc_session_id": "ff875009-...",
"ts": 1778139288759
diff --git a/examples/claude-code-memory-plugin/scripts/auto-recall.mjs b/examples/claude-code-memory-plugin/scripts/auto-recall.mjs
index bd1d25695..13c563a0c 100644
--- a/examples/claude-code-memory-plugin/scripts/auto-recall.mjs
+++ b/examples/claude-code-memory-plugin/scripts/auto-recall.mjs
@@ -399,7 +399,6 @@ async function main() {
hint_items: 0,
tokens_used: estimateTokens(endpointBlock),
tokens_budget: cfg.recallTokenBudget,
- top_score: 0,
cc_session_id: sessionId,
reason: "ok",
});
@@ -436,14 +435,12 @@ async function main() {
}
const built = await buildInjectionBlock(picked, effectivePeer.peerId);
- const topScore = picked.reduce((m, it) => Math.max(m, clampScore(it.score)), 0);
writeRecallState({
count: picked.length,
content_items: built?.contentCount ?? 0,
hint_items: built?.hintCount ?? 0,
tokens_used: built?.budgetUsed ?? 0,
tokens_budget: cfg.recallTokenBudget,
- top_score: topScore,
cc_session_id: sessionId,
reason: "ok",
});
diff --git a/examples/claude-code-memory-plugin/scripts/ov-status.mjs b/examples/claude-code-memory-plugin/scripts/ov-status.mjs
index 121697daa..6913ff86f 100644
--- a/examples/claude-code-memory-plugin/scripts/ov-status.mjs
+++ b/examples/claude-code-memory-plugin/scripts/ov-status.mjs
@@ -6,7 +6,7 @@
* - Server URL + /health probe
* - Resolved identity (account/user)
* - Last session-start injection (size, age, audit path)
- * - Last auto-recall (item count, top score, token budget use)
+ * - Last auto-recall (item count, token budget use)
* - Toggle state for the three injection paths
* - Auth source — which file/env actually drove url + api_key, mirroring
* config.mjs's priority chain (env → ovcli.conf → ov.conf → default)
@@ -94,12 +94,11 @@ async function main() {
// 3. Last auto-recall
const recall = readJsonState("last-recall.json");
if (recall) {
- const top = typeof recall.top_score === "number" ? recall.top_score.toFixed(2) : "?";
const used = recall.tokens_used ?? 0;
const budget = recall.tokens_budget ?? 0;
console.log(
`Last auto-recall: ${fmtAge(recall.ts)} — ${recall.count ?? 0} items, ` +
- `top ${top}, ${used}/${budget} tokens (${recall.reason || "ok"})`,
+ `${used}/${budget} tokens (${recall.reason || "ok"})`,
);
} else {
console.log("Last auto-recall: (none yet)");
diff --git a/examples/claude-code-memory-plugin/scripts/statusline.mjs b/examples/claude-code-memory-plugin/scripts/statusline.mjs
index ff67f0ed0..6bd681b79 100755
--- a/examples/claude-code-memory-plugin/scripts/statusline.mjs
+++ b/examples/claude-code-memory-plugin/scripts/statusline.mjs
@@ -189,16 +189,9 @@ async function main() {
// Recall summary: only meaningful when we actually injected memories this
// turn. Skip the segment for empty/bypass/no-results reasons to keep the
- // line tight. The (0.92) trailing parens is the top score among picked
- // items — quality hint without an extra segment. Token/char count is
- // omitted: the only number we have is a chars/4 heuristic, which is
- // misleading enough on CJK text that displaying it does more harm than
- // good. Count + score + latency convey the relevant signal.
+ // line tight. Count confirms the injection; latency shows its round-trip cost.
if (recall && recall.reason === "ok" && recall.count > 0) {
- const top = typeof recall.top_score === "number" && recall.top_score > 0
- ? ` (${recall.top_score.toFixed(2)})`
- : "";
- const seg = `↩ ${recall.count} mem${top}`
+ const seg = `↩ ${recall.count} mem`
+ (typeof recall.latency_ms === "number" ? ` · ${recall.latency_ms}ms` : "");
parts.push(dim(seg));
}