fix(memory): preserve native reranker score scale - #4249
Open
AaronZ345 wants to merge 2 commits into
Open
Conversation
AaronZ345
force-pushed
the
aaron/fix-logit-reranker-recall
branch
from
August 31, 2026 03:18
a9469a7 to
9ac8905
Compare
Allow memory plugins to compare reranker scores in the provider's native scale so logit-based rerankers can use negative thresholds without losing all recall results. Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
Keep the rebased test helper's temporary CLI config paths so precedence checks exercise the intended fixtures. Co-Authored-By: Claude Sonnet 4.6 noreply@anthropic.com
AaronZ345
force-pushed
the
aaron/fix-logit-reranker-recall
branch
from
September 1, 2026 04:39
9ac8905 to
e3c5c4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
[0, 1], so logit-scale rerankers can use native negative or >1 scores.Root cause
The memory plugin path assumed reranker scores were cosine-like
[0, 1]values. Local OpenAI-compatible rerankers such asbge-reranker-v2-m3can return raw logits, where relevant results may be negative. Clamping both configured thresholds and item scores made valid operator settings like-8ineffective and could filter out every recalled memory.Fixes #4224.
Test plan
node --test examples/memory-plugin-shared/recall-core.test.mjs examples/memory-plugin-shared/agent-hook-runtime.test.mjs examples/opencode-plugin/tests/config.test.mjs examples/pi-coding-agent-extension/tests/config.test.mjs examples/dsh-memory-plugin/live-recall.test.mjs examples/codex-memory-plugin/scripts/config.test.mjs examples/claude-code-memory-plugin/scripts/config.test.mjs examples/codex-memory-plugin/scripts/auto-recall.test.mjs examples/claude-code-memory-plugin/scripts/auto-recall.test.mjsgit diff --checkNote: I also ran the broader memory-plugin PR test command after
npm ci --prefix examples/dsh-memory-plugin. The #4224-related tests passed; unrelated local installer tests still fail in this checkout because the dev installer resolves the marketplace directory as/examples, and local TRAE CLI detection now includestrae-cnwhere existing assertions expect onlytrae.