feat: add Pi-style /tree conversation navigation#664
Open
piercebrookins wants to merge 1 commit into
Open
Conversation
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
Add a built-in
/treeplugin for navigating and branching the current conversation without changing Code Puppy's existing/forkbackground-agent command.Behavior
/forkand/forksare intentionally untouched; their existing background sub-agent semantics and tests remain intact.Implementation
The feature is plugin-first under
code_puppy/plugins/tree/:tree_model.py— append-only graph, provider-message extraction, filtering, and Pi-compatible navigation semanticstree_menu.py— prompt_toolkit selector and keyboard controlstree_storage.py— atomic sidecar persistenceregister_callbacks.py— slash-command/help/lifecycle integration and editor restorationNo command-line command was added to core.
Test plan
uv run ruff check code_puppy/plugins/tree tests/plugins/test_tree_plugin.pyuv run ruff format --check code_puppy/plugins/tree tests/plugins/test_tree_plugin.pyuv run pytest -q tests/plugins/test_tree_plugin.py tests/plugins/test_fork_plugin.py tests/plugins/test_plugin_contributions.py tests/i18n/test_i18n_coverage.py --no-cov/tree,/fork, and i18n suitesprotected_token_countexpected25000, observed24576)The
/treesuite includes a real POSIX pseudo-terminal smoke test that opens the selector, sends Up + Enter, and verifies the selected user prompt rewinds provider history to its parent.