fix(cache): make simhash hamming threshold configurable via TOML (T-P4-fix)#267
Merged
Destynova2 merged 1 commit intomainfrom Apr 25, 2026
Merged
fix(cache): make simhash hamming threshold configurable via TOML (T-P4-fix)#267Destynova2 merged 1 commit intomainfrom
Destynova2 merged 1 commit intomainfrom
Conversation
…4-fix) Adds [cache] simhash_threshold (u32, default 3) so operators can trade fuzzy hit rate against false positives without recompiling. The SimHashCache constructor with_threshold() already existed; ResponseCache now wires it from CacheConfig.simhash_threshold. - src/cli/config/cache.rs: new field with serde default + tests - src/cache/response_cache.rs: constructor takes simhash_threshold - src/server/init.rs: passes config.cache.simhash_threshold + logs it - tests/integration/cache_test.rs: callers updated
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
[cache].simhash_threshold(u32, default 3) so operators can trade fuzzy hit rate against false positives without recompiling.SimHashCache::with_threshold()already existed;ResponseCache::new()now takes the threshold and forwards it.Changes
src/cli/config/cache.rs: new field with serde default + 3 unit tests (parse, default-when-absent, Default impl)src/cache/response_cache.rs: constructor signature gainssimhash_threshold: u32src/server/init.rs: passesconfig.cache.simhash_thresholdand logs it on startuptests/integration/cache_test.rs: 5 callers updatedTest plan
Migration
Backward compatible: omitting
simhash_thresholdfrom[cache]keeps the previous behavior (threshold = 3).