Repository navigation
feat(tui): /fork and /tree over session forks (#463) - #567
Merged
Merged
Conversation
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This was referenced Nov 11, 2026
ajianaz
added a commit
that referenced
this pull request
Nov 11, 2026
[tui.keys] in the user config rebinds ten convenience actions (tool output, reasoning, model picker, cycle model, cycle thinking, newline, queue follow-up, pop queue, history) to a key spec or a list; the default keymap is the keys the TUI always had. y, n, Esc, Ctrl+C, Enter, Backspace, Tab and every bare character are never rebindable, and at an approval prompt only y, n, Esc and Ctrl+C act whatever the keymap says. A project config cannot set keys (ignored with a warning), and an invalid keymap falls back to the default with one startup note. Closes #463 with #567, #568 and #569.
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.
What
Part of #463 (TUI polish, part 2): the TUI commands
/fork [entry-id]and/tree, a UI over the session branching that #210 shipped. The issue stays open for export/copy, themes and keybindings.Why
tole branchandtole sessions --treeexist, but a TUI user had to leave the UI to fork or to find a related session. In-file branching (several branches in one session file) is a separate, still-deferred follow-up and is out of scope.Changes
/fork [entry-id]: forks the open session at a settled entry (default: the last one, astole branchdoes) into a new session and switches to it in place, like/newand/resume. The fork is indexed (facebranch), so/resumeandsessions --alllist it. An unknown or unsettled entry, or a session with nothing settled yet, is refused with the core error; the session and the sessions directory stay as they were.JsonlStorage::forkonly replays the source read-only (no lock, no repair, no write) and the new file takes its own sidecar lock. The host holds the session mutex across the fork, so no turn appends while the source is read./tree: a picker over the family of the open session (parent chain up to the root and every fork below it, siblings and grandchildren included), indented with└─by depth,(@entry)on forks, the open session marked(current)and preselected. Picking another row sends the existingHostCmd::Switch; picking the current row only says so. A session with no parent and no forks shows itself with a note. The depth marker is in theSessionItemlabel (no new field; the label is already host-composed text for/resume).HostCmd::{Fork(Option<String>), PickTree}answered withHostReply::Session/HostReply::Sessions; newPickKind::Tree. Hosts that do not implement them refuse them like other commands.tole-cli:session_index::{tree_nodes, tree_order, family}andTreeNode::of;sessions --treenow shares the same scan and ordering.tole-coreis unchanged./newand/resume. No transcript replay after the switch (unchanged limitation).docs/tui.md(commands table, "Forking" section, "Not implemented"), CHANGELOGUnreleased, README status line anddocs/epics.md(AGENTS.md section 7).Testing
cargo fmt --all,cargo clippy --workspace --all-targets -- -D warnings,cargo check -p tole-cli --no-default-features,cargo test --workspace: all green.tui_host.rs: fork at default and at an explicit entry while this process holds the lock,forkedFromcorrect, source byte-identical and resumable, new work lands only in the fork, unsettled/unknown/empty refused leaving no file; tree with parent, siblings and grandchildren; tree after fork. Unit test forfamily.tui_e2e.rs):/forkthen a new message lands in the fork (with history) and not the original;/treelists, switches back, the next message lands in the original;sessions --alland--treeshow the fork./treeswitching to the wrong id, a fork shown under no/wrong parent.corais not installed in the authoring environment: the staged diff was reviewed by hand; the CI Cora Review is the gate.