fix(memory): offline_update_trigger=True raises TypeError (wrong keyword for offline_update_all_entries) - #80
Open
Anai-Guo wants to merge 1 commit into
Open
Conversation
offline_update() passes update_sim_threshold=0.8, but offline_update_all_entries() takes score_threshold. Setting offline_update_trigger=True therefore raises TypeError before any offline update runs. score_threshold is the name used by every other call site in the repo (experiments/, mcp/server.py, README). Signed-off-by: Tai An <antai12232931@outlook.com>
6 tasks
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.
Problem
LightMemory.offline_update()triggers the offline update pass with a keyword the callee does not accept:https://github.com/zjunlp/LightMem/blob/main/src/lightmem/memory/lightmem.py#L453-L457
but the method is declared as (
lightmem.py:541):So any call to
offline_update(..., offline_update_trigger=True)raisesright after the "Triggering offline update for all entries" line is logged — the offline update never runs.
Why
score_thresholdis the intended nameupdate_sim_thresholdappears exactly once in the whole repository — at this call site. Every other caller of the same method usesscore_threshold, and two of them use the same0.8value:experiments/longmemeval/offline_update.py:41score_threshold=0.8experiments/locomo/add_locomo.py:447score_threshold=0.9mcp/server.py:200score_threshold=score_thresholdREADME.md:327score_threshold=0.8The sibling trigger immediately above (
construct_update_queue_all_entries(top_k=20, keep_top_n=10)) already uses the callee's real parameter names, which makes this the one call site that drifted.Fix
One-line rename of the keyword at the call site. The intended value (
0.8, overriding the0.9default) is preserved.Verification
Signature replay against the real source (parameters extracted from
lightmem.pywithast, annotations/defaults stripped, theninspect.Signature.bind):I do not have the vector-store/LLM backends configured locally, so this is a static verification of the call rather than an end-to-end offline-update run.
🤖 Generated with Claude Code