fix(core_pool): load legacy cli/root checkpoints after owner resolve - #18
Draft
cursor[bot] wants to merge 1 commit into
Draft
fix(core_pool): load legacy cli/root checkpoints after owner resolve#18cursor[bot] wants to merge 1 commit into
cursor[bot] wants to merge 1 commit into
Conversation
_resolve_core_owner (dae8be7) corrected feishu session memory paths but _load only read checkpoint.json under the resolved owner. Sessions switched via CLI that still had checkpoints under cli/root cold-started on daemon restart, losing conversation state. Probe resolved owner first, then fall back to the caller-supplied owner, and migrate restored legacy checkpoints to the resolved path. Co-authored-by: Yuxuan Liu <Osc-7@users.noreply.github.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.
Bug and impact
Commit dae8be7 added
_resolve_core_ownerso Feishu/sub/cron sessions no longer log or store memory undercli:rootwhen acquired via CLI session switch. However,_load()only readcheckpoint.jsonfrom the resolved owner path.Concrete trigger: User switches CLI to a
feishu:user:…session while checkpoints were still saved underdata/memory/cli/root/. On daemon restart,restore_from_checkpointsfinds the legacy file but_load()looks underfeishu/{open_id}/, misses it, and cold-starts — conversation state is lost.Root cause
Owner correction changed the lookup namespace without probing the legacy on-disk location used before the fix (or by
restore_from_checkpointswhich still passesckpt.source/ckpt.owner_id).Fix
_checkpoint_owner_candidates/_read_session_checkpointto probe resolved owner first, then the caller-supplied owner._load()for both CoreProfile recovery and full checkpoint restore.Validation
test_read_session_checkpoint_falls_back_to_legacy_cli_rootuv run pytest tests/test_core_owner_resolve.py -v— all 7 tests pass