Add session tree navigation commands#387
Closed
piercebrookins wants to merge 2 commits into
Closed
Conversation
piercebrookins
force-pushed
the
feature/session-tree-fork
branch
from
June 7, 2026 17:47
83d7efb to
2dcfa1b
Compare
piercebrookins
force-pushed
the
feature/session-tree-fork
branch
from
June 7, 2026 17:55
2dcfa1b to
c83efbb
Compare
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
Adds persistent, pi-inspired conversation branching through
/tree,/fork, and/clone.Why
A linear message list cannot preserve an abandoned branch after rewinding. The first implementation rendered tree glyphs beside that linear list, used process-local labels, and destructively discarded history. This revision stores a real append-only conversation graph per autosave session and reconciles the active pydantic-ai history into it.
What changed
SessionTreestore under the autosave directory, with stable node IDs, parent links, labels, timestamps, active-leaf state, and message payloads./treerenders actual branch depth/connectors and distinguishes the active leaf/path./tree summarynow summarizes only the abandoned tail after the common ancestor and attaches that context at the destination. Failures leave active history untouched./forkuses the same tree selector in user-only mode rather than an unrelated numbered text menu./clonesaves the active branch as a separate autosave artifact without rotating or mutating the current session identity./fork, and/clone.Validation
uv run ruff check .uv run pytest tests/plugins/test_session_tree.py -q --no-cov(14 passed)git diff --checktest_builder_autostart_mcp,test_add_model_menu_coverage, and live compaction/provider tests).