fix(source): write MetaCache back in ReloadSession and share instance with loader#63
Merged
Conversation
…itle/CWD on cold start Closes #18
Prevents two independent MetaCache snapshots from clobbering each other when applyRefresh saves new metadata while LoadClaudeStream is still running and saves its own snapshot afterwards.
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
ReloadSessionnow accepts a*MetaCacheparameter and callscache.Store()after parsing, so the refreshed title/CWD is persisted on the nextSave()instead of being lostpicker.Modelholds ametaCachefield;applyRefreshcallsmetaCache.Save()after each refresh batchLoadClaudeStreamWithCacheadded somain.gopasses the same*MetaCacheinstance to both the streaming loader and the picker — eliminates the race where the loader's stale snapshot could overwrite the picker's freshly-saved metadataTest Plan
TestReloadSession_WritesMetaCache— verifies cache entry is present afterReloadSessionTestLoadClaudeStreamWithCache_UsesSharedInstance— verifies shared instance receives entries from the loadergo test ./...passesCloses #18