Add fork-from-message for branching conversations#39
Draft
amknight wants to merge 1 commit into
Draft
Conversation
Adds a Codex-style fork affordance on assistant messages. Hovering an
assistant response reveals a subtle Fork control below it; clicking opens
a dialog to branch the conversation into a new sidebar thread containing
history up to and including that response, with an empty composer.
The dialog offers a worktree choice (same worktree or a new worktree),
mirroring the new-thread environment toggle and building on the existing
tree/branch infrastructure.
- session-driver: ForkPosition ("before"|"at"|"after"), ForkSessionOptions/Result
- pi-sdk-driver: forkSession using native getBranch + createBranchedSession
- electron: forkThread IPC wiring (additive; no config/userData changes)
- renderer: fork button (timeline), fork-modal, App wiring, styles
- tests: core fork-from-message spec; on-demand demo spec (ignored by default)
|
@amknight is attempting to deploy a commit to the dev Team on Vercel. A member of the Team first needs to authorize it. |
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 a Codex-style fork-from-message affordance for branching conversations.
Hovering an assistant response reveals a subtle Fork control just below it. Clicking it opens a dialog to branch the conversation into a new sidebar thread containing history up to and including that response, with an empty composer. The original thread is left untouched.
The dialog offers a worktree choice (same worktree or a new worktree), mirroring the existing new-thread environment toggle and building on the existing tree/branch infrastructure.
Changes
ForkPosition("before" | "at" | "after"),ForkSessionOptions/ForkSessionResult,forkSessionon the driver interface.forkSessionimplementation using the nativegetBranch+createBranchedSessionprimitives;"after"positions the branch at the end of the selected turn (empty composer).forkThreadIPC wiring (main.ts,preload.ts,app-store.ts,app-store-worktree.ts) — purely additive; no config/userData/provider changes.timeline-item.tsx,conversation-timeline.tsx),fork-modal.tsx,App.tsxwiring, icon + styles.tests/core/fork-from-message.spec.ts(real Electron surface); on-demandtests/demo/fork-demo.spec.ts(excluded from default discovery viatestIgnore).Verification
pnpm --dir apps/desktop run typecheck— passes (renderer + electron).Notes
videos/fork-from-message-demo.webm); not committed to keep the tree free of binaries — can attach to this PR on request.