fix(agentmain): make /resume fall back to L4 archives (v2, re-roll onto current main)#704
Open
Kailigithub wants to merge 1 commit into
Open
Conversation
The /resume handler hardcoded the prompt to read temp/model_responses/
but the archival pipeline in memory/L4_raw_sessions/compress_session.py
deletes the raw .txt files once it has merged them into
all_histories.txt and the monthly {YYYY-MM}.zip archives. The data is
still recoverable; the agent just isn't told to look for it.
Extend the /resume prompt so the agent falls back to the L4 archives
when fewer than 5 files remain in temp/model_responses/.
Re-roll of lsdefine#653 onto current main (original PR drifted into CONFLICTING
state at 23 days stale).
Closes lsdefine#630
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
Extend the
/resumeslash command prompt so the agent falls back to L4 archive artifacts (all_histories.txt,{YYYY-MM}.zipinmemory/L4_raw_sessions/) when fewer than 5 raw.txtfiles remain intemp/model_responses/.Problem
memory/L4_raw_sessions/compress_session.pyarchives raw session.txtfiles once it merges them intoall_histories.txtand the monthly{YYYY-MM}.ziparchives. The/resumehandler inagentmain.pyhardcoded the prompt to readtemp/model_responses/only — so users who ran/resumeafter L4 archival completed saw an empty session list, even though their history was recoverable from the archives.Fix
Single-source change in
agentmain.py: extend the/resumeprompt so the agent first triestemp/model_responses/(live), and on<5 files remainingfalls back tomemory/L4_raw_sessions/all_histories.txt(consolidated history) ormemory/L4_raw_sessions/{YYYY-MM}.zip(monthly archive).Verification
python3 -m py_compile agentmain.py— syntax OK/tmp/test_issue_630.py— 4 checks:/resumeprompt string was removed.all_histories.txt,memory/L4_raw_sessions,{YYYY-MM}.zip, and少于 5 个(fallback threshold) are all present.if raw_query.strip() == '/resume':is still in the file.returnstatement still starts with the resume directive.Scope