Repository navigation
Fork a Chat UI chat from any finished response - #38326
Merged
Merged
Conversation
Adds the create-time fork source, the host fork capability, the agent fork level, the forked-from record relationship and the forked-from divider row.
A launch with forkFrom {sessionId, throughItemId} keeps it on the create call,
the saved launch record, reload, retry and its holders, sends no new-chat
options, and is refused before create on a host that does not advertise forks.
Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Finished root responses offer "Fork from this response" where the host and agent can fork: disabled while support is unknown or a fork is opening, opened in a new tab right after the source, with one toast naming the agent on failure. The forked-from row draws as a divider linking to its source. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The sheet offers "Fork from this response" with the desktop's eligibility and host capability, creates the fork through the phone's chat create, and draws the forked-from divider with a link to the source chat. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
A displayed row can be a tool call or a status projected as a plan while reading as a response; both clients now check the journal row's own kind. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The phone names its source tab as the create's placement and the host takes that tab's group; a paired desktop sends the address captured at the click when the fork has no tab of its own yet. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…a line The action on a response the turn continues past hangs from a line of no height, as the reply controls hang into the gap, so tool-heavy turns keep their spacing. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The options read already says whether the installed agent forks; an observed no hides the action, an unanswered read keeps it disabled, and yes enables it. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The forked-from link now asks the controller's existing opener for the source by history id, so it follows that opener's host, selection and reveal rules instead of navigating on its own. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The floated action covered the start of the next row. It now sits beside the response's last line, in a gutter as tall as the prose, so it adds no line and never reaches the following row. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
First adoption put every unseen tab at the end of its group, so a fork the host published after its source landed last. A new tab now follows its nearest host predecessor when that tab is here; tabs already adopted keep the user's order. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…rst frame The gutter came and went with the fork offer, so prose reflowed when a turn finished or support resolved. A pane that draws forks now keeps it on all root responses, and the fork sits only there, not also beside Copy. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
The divider's separator role and row label hid the source chat button inside it; the rules are now decorative and the text and button read normally.
…hat-fork # Conflicts: # mobile/src/session/MobileSessionActiveContent.tsx
An empty actions group still shifted the time by the icons' edge margin on rows with no copy, fork or rewind.
The fork button sat alone in a right gutter far from the other row actions. It now joins the response's existing hover controls next to Copy, where those controls show, and the gutter is gone. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…the Fork slot A turn whose last prose was followed by tool or thought rows showed no Copy and no Fork anywhere until it was collapsed. The actions now belong to the turn's last prose row, decided when the transcript's rows are built, and keep the gap below it whole so they never cover the next row. Root responses also keep an empty Fork slot when not offered, so resolving support never moves the row's other actions. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
An image-only reply after the turn's text took the response actions but could not draw them, so the text lost Copy and Fork. Slot construction now picks the turn's last reply by the same words the row draws and copies. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
…text is folded A collapsed turn that ends in an image hides its earlier text, so no drawn row could show the response actions and Fork vanished. Each turn's actions now go to its last drawn response with words, else its last with images. Copy and its context-menu target appear only where there are words to copy. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
brennanb2025
marked this pull request as draft
November 6, 2026 06:15
brennanb2025
marked this pull request as ready for review
November 6, 2026 06:15
Main deleted transcript-opencode.test.ts and transcript-opencode2-sqlite.test.ts. Honor both deletions except the branch's real-SQLite OpenCode fork-tip regression, kept with its minimal fixture.
This was referenced Nov 6, 2026
7 of 9 tasks
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.
Problem
In Chat UI there was no way to branch a conversation. Every existing "fork" left Chat UI: "Resume in New Terminal" makes a real fork but always in a terminal, and "Fork Agent Session…" pastes the chat's text into a brand-new agent in a new worktree, so it's a new conversation, not a fork. You couldn't try a different direction from an earlier answer and keep the original chat as it was.
What this changes for users
How it works
Plan
This change touches saved data (a new record field), the create wire format, and chat adoption. The plan and both independent reviews are in the lane notes; the architecture was settled by an independent decider.
Differences from the common pattern
/forkcommand yet. Intended (owner ruling): per-message fork first.Verification
QA with real Claude and Codex runs on the final head; results are posted in the status comment.