mirror of
https://github.com/mark3labs/kit.git
synced 2026-06-14 03:30:26 +00:00
49ff4c0678
performFork() called ClearMessages() after Branch(targetID), but ClearMessages() calls TreeSession.ResetLeaf() which sets leafID back to empty — immediately undoing the branch. The in-memory message store was also never reloaded from the tree session after branching, so the LLM had zero context. Add ReloadMessagesFromTree() which clears the store and reloads it from the tree session's current branch without resetting the leaf pointer. Use it in performFork() instead of ClearMessages().