Skip to content

fix(source): write MetaCache back in ReloadSession and share instance with loader#63

Merged
gadflysu merged 2 commits into
masterfrom
fix/18-metacache-reload
Jun 16, 2026
Merged

fix(source): write MetaCache back in ReloadSession and share instance with loader#63
gadflysu merged 2 commits into
masterfrom
fix/18-metacache-reload

Conversation

@gadflysu

Copy link
Copy Markdown
Owner

Summary

  • ReloadSession now accepts a *MetaCache parameter and calls cache.Store() after parsing, so the refreshed title/CWD is persisted on the next Save() instead of being lost
  • picker.Model holds a metaCache field; applyRefresh calls metaCache.Save() after each refresh batch
  • LoadClaudeStreamWithCache added so main.go passes the same *MetaCache instance to both the streaming loader and the picker — eliminates the race where the loader's stale snapshot could overwrite the picker's freshly-saved metadata

Test Plan

  • TestReloadSession_WritesMetaCache — verifies cache entry is present after ReloadSession
  • TestLoadClaudeStreamWithCache_UsesSharedInstance — verifies shared instance receives entries from the loader
  • go test ./... passes

Closes #18

gadflysu added 2 commits June 16, 2026 17:06
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.
@gadflysu gadflysu merged commit ef443d2 into master Jun 16, 2026
4 checks passed
@gadflysu gadflysu deleted the fix/18-metacache-reload branch June 16, 2026 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ReloadSession does not write back to MetaCache — stale title and CWD on next cold start

1 participant