feat: add conversation turn tree navigation#3362
Open
ZolHo wants to merge 1 commit into
Open
Conversation
c2f5d7e to
586c089
Compare
Author
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.

Why
DeepSeek-style prefix caching is most valuable when users can reuse a stable conversation prefix instead of repeatedly rebuilding the same context. For larger tasks, a common workflow is to establish project assumptions early, then branch from that shared prefix to investigate different implementation directions or problem areas.
Manual session forking can support that workflow, but it makes the session list noisy and difficult to manage as branches accumulate. This PR adds turn-level conversation tree navigation so users can understand the current conversation's branch structure, jump back to any saved node, and continue from that point with much lower friction.
The goal is to make cache-friendly long-task workflows easier: users can keep stable context in one prefix, inspect where branches came from, and create new branch conversations cheaply when they need to explore a different path.
If you feel the overall direction of my approach is sound but the code isn't suitable for merging, we can also defer this issue to a future milestone and close this PR.
What Changed
/turntreenavigation so terminal users can view the current conversation branch tree, select a node, and continue from that point.Manual Verification
Verified the intended user flows:
/turntreedisplays the current conversation branch tree, allows selecting historical nodes, and supports continuing from the selected point as a new branch.Verification
Automated checks:
go test ./internal/agent ./internal/controlgo test ./internal/agent ./internal/cli -run 'TurnTree|ListSessions|TopicMigration|ManualNewline|SoftWrapped|ComposerGrow'go test . -run TurnTreefromdesktopnpm run typecheckfromdesktop/frontendFormatting checks:
gofmt -l desktop\tabs.go internal\agent\save.go internal\cli\chat_tui.go internal\cli\turntree.gogit diff --check