Repository navigation
feat(sessions): fork completed replies while later turns run - #843
Merged
vastsa merged 3 commits intoSep 24, 2026
Merged
Conversation
Allow the completed assistant prefix to become an independent session without stopping or hydrating over its streaming parent. Keep live-turn and whole-session busy guards in the authoritative host. Refs vastsa#837
Include the new WebDAV compatibility work before candidate validation. Preserve the original PR behavior and both upstream and author history.
Preserve independent E2E additions from both branches without changing the reply-fork behavior.
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.
Related to #837. As clarified in the issue, waiting for the source turn to finish is the current design. This PR proposes allowing a Desktop branch from an earlier completed assistant reply while a later turn is still running.
The child receives only the completed prefix and can continue independently; the parent keeps streaming. Host validation still rejects whole-session busy forks and any prefix belonging to a running turn, including completed intermediate replies inside an active tool loop. Native Pi ownership rules stay unchanged. The renderer avoids hydrating over the live source transcript.
Verified in the real macOS desktop with DeepSeek
deepseek-flash: the earlier reply's branch action created no child on the old code; with this change it created a child while the parent ran, and both conversations then completed independently. No simulated model, delayed responses, or injected renderer state was used.Real desktop screenshots (2400 × 1600, test conversations only)
Before: clicking the completed reply's branch action while the next turn runs leaves the source unchanged.
After: the child contains the first exchange; the parent's orange running indicator remains visible in the sidebar.
The child accepts its own follow-up while the parent continues.
These are actual desktop captures, not a reconstructed UI or continuous recording.
Validation covers prefix boundaries, source/child independence, renderer navigation races, and IPC busy-error mapping. Relevant tests, JS build, desktop typecheck, lint, architecture, docs, Rust formatting, and Clippy pass. The full Host suite on this branch has one pre-existing config-sync environment failure, reproduced on unchanged main and addressed separately in #842.
Candidate
609d7575ea3f5c7e67aecdbfContinuous desktop recording
pr-843-desktop.mp4
Recorded from the real macOS Electron window built at
a78c6cbbc5f2(base3a45d01ae4ba), using actual DeepSeekdeepseek-flashrequests in an isolated test profile. It shows the first completed exchange, a later running turn, branching from the earlier reply, an independent child follow-up, and returning to the independently completed parent. No model fixture, network delay, state injection, or reconstructed UI is used.The source is continuous native window video, not a screenshot sequence. The 1920 × 1334 edit preserves the action sequence; only the marked parent wait is 3× speed, with unused recording tail removed. Captions and the sidebar outline are editorial annotations. This recording supersedes the older candidate metadata above for the demonstrated desktop flow.