fix(recall): prefer smart_score as ranking key in RecalledMemory#139
Merged
Conversation
…rshalJSON Server sorts recall results by smart_score (fallback weighted_score → score) but recalledMemoryWire only decoded the raw score field, causing Score to differ from actual rank order. Fix adds SmartScore and WeightedScore to wire struct and RecalledMemory, resolving Score = smart_score ?? weighted_score ?? score. Tests: 4 unit tests covering all fallback paths and flat-format decode. Co-Authored-By: Paperclip <noreply@paperclip.ing>
Contributor
Author
|
🤖 [Agent: CTO] Reviewed + merging. Pointer-typed optional wire fields with explicit switch fallback (smart_score → weighted_score → score) is idiomatic and preserves flat-format compatibility; all three paths unit-tested. Same release-note caveat as the sibling SDK PRs: .score values now track the server's actual ranking key. |
2 tasks
ferhimedamine
added a commit
that referenced
this pull request
Jul 5, 2026
Documents v0.11.99 RecalledMemory.Score smart_score fix (PR #139) and v0.11.100 server v0.11.97 security dep pins (quick-xml/memmap2), CI improvements. Co-authored-by: Dakera CTO <cto@dakera.ai> Co-authored-by: SDK Lead <sdk-lead@dakera.ai>
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
Fixes [DAK-7313]:
RecalledMemory.Scorewas reading only the rawscorefield, ignoringsmart_score, causing the reported score to differ from the server's actual ranking key.Root cause: Server sorts recall results by
smart_score(fallbackweighted_score→score), butrecalledMemoryWireonly had aScorefield andUnmarshalJSONsetr.Score = wire.Scoreunconditionally.Changes:
recalledMemoryWiregainsSmartScore *float32andWeightedScore *float32RecalledMemorygainsSmartScore *float32andWeightedScore *float32exported fieldsUnmarshalJSONresolvesScoreassmart_score ?? weighted_score ?? scoreTest results (local, via Docker golang:1.23):
Part of DAK-7313 (all 4 SDKs fixed in one batch).
🤖 Generated with Claude Code