fix(skill-store): fix broken embed calls and dedup threshold - #1001
Merged
lightzt99 merged 1 commit intoJun 11, 2026
Merged
Conversation
Two bugs made the skill distillation storage pipeline non-functional: 1. self._embed() was never defined on Memory — all add_skill() and search_skills() calls raised AttributeError at runtime. Fixed by replacing with self.embedding.embed() (5 call sites). 2. Dedup similarity_threshold defaulted to 0.75, but skill search uses RRF fusion whose max possible score is 4*(1/60) = 0.0667. The dedup condition could never trigger, making merge dead code. Changed default to 0.03 (fires when ~2+ search lanes match at rank 0). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
The skill distillation storage pipeline (
add_skill(),search_skills()) was non-functional due to two compounding bugs:self._embed()was never defined on Memory — all calls raisedAttributeErrorat runtime. Replaced withself.embedding.embed()at 5 call sites.similarity_thresholddefaulted to 0.75, but the skill store's RRF fusion score maxes out at4*(1/60) = 0.0667. The dedup condition could never trigger, making the merge path dead code. Changed default to 0.03.Details
Bug 1:
_embedundefinedBug 2: threshold/score-space mismatch
Test plan
self.embeddingis unconditionally set in__init__(line 268)embed()signature is compatible across all 16 embedder implementationsself._embed(calls in codebase_embed(no breakage)add_skill()andsearch_skills()have no dedicated test coverage (pre-existing gap)🤖 Generated with Claude Code