Problem
In src/memos/mem_reader/strategy_struct.py line 58, there is a dead code branch:
if self.config.remove_prompt_example: # TODO unused
prompt = prompt.replace(examples, "")
examples is set to SIMPLE_STRUCT_MEM_READER_EXAMPLE (or the ZH variant), but the strategy prompt template (STRATEGY_STRUCT_MEM_READER_PROMPT / STRATEGY_STRUCT_MEM_READER_PROMPT_ZH) does not contain that example text. As a result, prompt.replace(examples, "") is always a no-op regardless of the config flag value.
The remove_prompt_example config field itself is still used correctly in simple_struct.py and multi_modal_struct.py — only the branch in strategy_struct.py is dead.
Proposed Fix
Remove the dead branch from _get_llm_response in StrategyStructMemReader:
# Remove these two lines:
if self.config.remove_prompt_example: # TODO unused
prompt = prompt.replace(examples, "")
# Also remove the unused `examples` variable assignment above it
The remove_prompt_example field in StrategyStructMemReaderConfig should remain as it is inherited from BaseMemReaderConfig and used by other readers.
Files
src/memos/mem_reader/strategy_struct.py lines 48, 58–59
Problem
In
src/memos/mem_reader/strategy_struct.pyline 58, there is a dead code branch:examplesis set toSIMPLE_STRUCT_MEM_READER_EXAMPLE(or the ZH variant), but the strategy prompt template (STRATEGY_STRUCT_MEM_READER_PROMPT/STRATEGY_STRUCT_MEM_READER_PROMPT_ZH) does not contain that example text. As a result,prompt.replace(examples, "")is always a no-op regardless of the config flag value.The
remove_prompt_exampleconfig field itself is still used correctly insimple_struct.pyandmulti_modal_struct.py— only the branch instrategy_struct.pyis dead.Proposed Fix
Remove the dead branch from
_get_llm_responseinStrategyStructMemReader:The
remove_prompt_examplefield inStrategyStructMemReaderConfigshould remain as it is inherited fromBaseMemReaderConfigand used by other readers.Files
src/memos/mem_reader/strategy_struct.pylines 48, 58–59