fix(auto-recall): respect recall.maxResultsDefault config instead of hardcoding 10#1541
Open
octo-patch wants to merge 1 commit intoMemTensor:mainfrom
Open
Conversation
…hardcoding 10 Auto-recall was hardcoding maxResults: 10 for both local and Hub searches, ignoring the user-configured recall.maxResultsDefault value. This caused unexpectedly high token consumption for users who had set a lower limit. Now reads ctx.config?.recall?.maxResultsDefault ?? DEFAULTS.maxResultsDefault (default 6) for both local and Hub search calls in the before_prompt_build hook. Fixes MemTensor#1514 Co-Authored-By: Octopus <liyuan851277048@icloud.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.
Fixes #1514
Problem
The auto-recall
before_prompt_buildhook hardcodesmaxResults: 10for both local and Hub memory searches, ignoring the user-configuredrecall.maxResultsDefaultvalue. This means users who set a lower limit (e.g. 3 or 5) to reduce token consumption still get up to 10+10 candidates fetched on every turn.Solution
Read
ctx.config?.recall?.maxResultsDefault ?? DEFAULTS.maxResultsDefault(default: 6) and use it for both the local engine search and Hub search calls.Testing
recall.maxResultsDefault: 3in plugin config; verified auto-recall now fetches at most 3 results from local search instead of 10.DEFAULTS.maxResultsDefault(6), unchanged from existing behavior intent.