Skip to content

feat(chat): add fork with another model to a reply's menu - #35517

Merged
bolichen97 merged 1 commit into
mainfrom
fix/35226-fork-with-another-model
Nov 12, 2026
Merged

bolichen97 merged 1 commit into
mainfrom
fix/35226-fork-with-another-model

Conversation

@bolichen97

@bolichen97 bolichen97 commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Problem / Motivation

Goal: a person can fork a chat onto a second model in one menu action, so the same question can be asked of that model.

To ask a second model the same question today, a person forks, opens the new chat, opens its model picker, changes the model and types the prompt again. A reply's More menu has no entry that ends on the model choice.

Why it matters

Comparing two models on one conversation is a common reason to fork. Each extra step is friction, and a fork that silently starts on the parent's model is easy to send on the wrong model.

Not a goal

  • No model field on the fork request, and no change to /fork <prompt>.
  • No change to the agent's session_fork tool.
  • No side-by-side comparison view.

What changed (motivation → approach → change)

A reply's More menu gets Fork with another model. It forks the chat with this message and the ones before it, then opens the new chat's own model picker. The person picks the model there, and the effort with it where the harness offers one. The parent chat does not change.

The picker is the composer's existing one, so model and effort stay one control (docs/decisions/2026-06-14-chat-composer-model-and-effort-are-one-control.md) and the pick goes through the same route and checks as any other pick. A second, fork-only model list would have had to copy those rules. The maintainer ruling is on the issue and recorded as a new docs/decisions/ entry.

Piece Behaviour
The menu entry Listed after the fork entries once the fork point resolves. With Tail-only Fork on it carries the same "starts a new chat with this message and the ones before it" line as "Fork with earlier messages". While it runs it reads "Forking…" and the other fork entries wait.
The picker Opens only when the new chat is the one on screen after the switch. If the person opened another chat meanwhile, it stays an ordinary fork.
Until a pick The new chat keeps the parent's model and effort; a concrete pick there replaces a routed Auto choice.
Docs and strings docs/system-specs/modules/history.md describes the entry; one new string in every catalog under website/src/i18n, with its translator note.

Backwards compatibility

Compatible: an added menu entry; the existing fork entries, the fork request and its response are unchanged, and handleFork resolving whether the new chat opened is read only by the new entry.

Removes nothing: the diff adds a menu entry, one string and docs.

Tests

  • website/src/test/AssistantMessage.forkWithModel.test.tsx: the entry is listed after the fork entries with its label and line, and hands the fork point to its own handler; it is not offered before the fork point resolves.
  • website/src/pages/ChatPage.transcriptRendering.test.tsx: the entry forks with the earlier messages and opens the model picker only when the fork opened the new chat.
  • website/src/test/forkRespectsSwitchAway.test.tsx: handleFork resolves false when the person opened another chat while the fork ran, and reports the opened chat otherwise.

Determinism: the three files plus the other fork suites (ChatPage.handleFork, ChatSidebar.forkOpensCollapsedFolder, forkOpenPending, catalog parity) passed three runs in shuffled order (139 tests each).

Manual verification

  • The whole flow on an isolated gateway built from this branch, with a seeded chat: the reply's More menu lists the entry; choosing it opened "↳ Fork of Composer PR notes" with its model picker open, the parent unchanged.
  • The menu on the real AssistantMessage in Chromium (a local capture page, not committed): entry order with Tail-only Fork on and off, light and dark, the in-flight state, and that a click hands the fork point to the new handler.

Screenshots / video

The menu on a finished reply, and the new chat right after choosing the entry:

More menu with Fork with another model

The forked chat with its model picker open

With Tail-only Fork on, light theme, and while the fork runs

Tail-only Fork on: three fork entries, each with its line

Light theme, Tail-only Fork off

While the fork runs: the entry reads Forking, the others wait

Related Issues

Closes #35226

Checklist

  • At most two commits (one is the norm), with a Conventional Commits title (feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)
  • Existing tests pass and new tests added for new functionality
  • Self-review completed; code follows project style guidelines
  • Documentation updated (if applicable)
  • No secrets, credentials, or internal references in the diff

@bolichen97
bolichen97 requested review from a team and KiroCrewCaptain as code owners November 11, 2026 19:36
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Nov 11, 2026
@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

First Principles Review (Opus 5.5) — ✅ PASS

Premise-level review of e741856fe5b8f5f6551c1f9892ef56110c592107 — why this exists and whether the shipped surface is the smallest honest version. Updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

First-Principles-Verdict: PASS

Nothing blocks: the new menu entry reuses the existing fork request and the composer's model picker (openModelPickerFromError), and the existing fork entries stay as they were.

Notes

  • Item 4 — undeclared: the hunk return store.getState().chat.activeSlot === result.key gives handleFork a boolean result. Only one caller reads it (handleForkWithModel; grepped handleFork( callers in transcriptRendering.tsx). It is in-tree only and could be reversed later.

What this change ships

Inventory (6 items) — 5 justified

Intent: let a person fork a chat and ask the same question of a second model in one menu action. This is an ADDITION.

  1. A reply's More menu lists "Fork with another model" after the fork entries — justified
  2. Choosing it forks with the earlier messages, then opens the new chat's own model picker — justified
  3. The picker stays shut if the person opened another chat while the fork ran — justified
  4. handleFork now reports whether the new chat is the one on screen — undeclared, one consumer
  5. While any fork runs, every other fork entry shows "fork in progress" as its second line — justified
  6. A new decision record, a history.md spec paragraph and one string in every locale — justified

[FIRST-PRINCIPLES-REVIEWED] e741856

Description read

[DESCRIPTION-READ] c6ff5e6b0e7a1a0023af30d855cd3e71e720e2eca1bf60d6158119e4e3fb1241

That sha256 names the PR description this verdict read. Recompute it with .github/scripts/pr-description-capture.sh; if it differs, the description changed after this verdict was formed and any finding drawn from the description is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Design Review (Opus 5.5) — ✅ PASS

Design-level review of e741856fe5b8f5f6551c1f9892ef56110c592107 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

Design-Verdict: PASS

Nothing blocks: the new entry reuses the existing fork path and the composer's own model picker, and it adds no new request field or second model list.

Notes

  • openModelPickerFromError opens a picker that is not tied to any one chat, and it anchors on the composer chip it finds on the page. Whether the pick lands on the fork depends on the chip and the active slot having moved to the new chat by then. The activeSlot === result.key check covers the slot; a test that the pick is applied to the fork's key would cover the rest.

[DESIGN-REVIEWED] e741856

Description read

[DESCRIPTION-READ] a85fa353999a55c8eb278cd98f30082df9b884727d457cc48de52e40ea31b96e

That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

UX Review (Opus 5.5) — ✅ PASS

UX-level review of e741856fe5b8f5f6551c1f9892ef56110c592107 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS does not.

UX-Verdict: PASS

Nothing blocks. The blind reader correctly read the new entry as "the same copy, but with a different AI answering", and every state the diff adds appears in a screenshot.

Notes

  • With Tail-only Fork on, "Fork with another model" shows the same second line as "Fork with earlier messages" (fork_earlier_messages_hint). The blind reader said: "the explanation is word-for-word the same as the item above… I can't tell the two apart from the text." Add a string of its own, e.g. "Starts a new chat with this message and the ones before it, then lets you pick its model. This chat is not changed."
  • When the picker opens on the fork (shot-02), nothing says the fork already exists or what happens if the picker is closed. The reader asked: "whether I'm required to pick an AI now… Closing the box might leave me with the same AI I already had." A one-line heading in the picker for this case, e.g. "Pick a model for this fork", would answer that.

[UX-REVIEWED] e741856

Description read

[DESCRIPTION-READ] 8957e2f0bd782a8459bd4be36bf3cfbd82321a5dac030025d5feed6b42d05538

That sha256 names everything this verdict read: the PR description, plus the 8 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with .github/scripts/pr-description-capture.sh over the same inputs; if it differs, the description or that evidence changed after this verdict was formed and any finding drawn from either is unproven.

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Opus 5.5 Review — ✅ no blocking findings

Reviewed e741856fe5b8f5f6551c1f9892ef56110c592107 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] e741856

Verdict parsed from the review's SHA-scoped output markers for commit e741856fe5b8f5f6551c1f9892ef56110c592107.

False positive or not applicable? A repository writer can comment:
/ai-review override fable e741856fe5b8f5f6551c1f9892ef56110c592107 false-positive: <reason, 20 to 500 characters>

@github-actions

github-actions Bot commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

GPT 6.1 Review — ✅ no blocking findings

GPT 6.1 completed its review of e741856fe5b8f5f6551c1f9892ef56110c592107 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] e741856

False positive or not applicable? A repository writer can comment:
/ai-review override gpt e741856fe5b8f5f6551c1f9892ef56110c592107 false-positive: <reason, 20 to 500 characters>

@bolichen97
bolichen97 enabled auto-merge (squash) November 11, 2026 19:48
@KiroCrewCaptain

KiroCrewCaptain commented Nov 11, 2026 •

Copy link
Copy Markdown
Collaborator

Code change approver recommendation: Approve

Why: the decider estimates a 12% chance that this change introduces a defect, within the 12% limit for approving on its own, and every check passes.

Adds a "Fork with another model" entry to a reply's More menu. It reuses handleFork with direction 'head' and then opens the composer's existing model picker, but only when handleFork reports that the new chat is the open one. handleFork now reports true only after the switch lands on result.key, and false on every other path. Its only reader is the new handler; the other fork entries are unchanged apart from sharing the busy state with the new entry. The entry is gated like the existing fork entries (embedded/popout, fork point resolved). Tests cover the menu order, which handler is called, the picker opening only when the fork opened the new chat, and the false result after a switch-away. Strings are added to every catalog, and the spec and decision record are updated. No regressions or trust issues found.

An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit e741856fe5 · 190 changed lines. If this recommendation is wrong, reply here: replies are how the approver is evaluated.

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention and removed readiness: checking Automated validation is still running labels Nov 11, 2026
buluoray
buluoray previously approved these changes Nov 11, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on b66bfc6. This adds "Fork with another model" to a reply's More menu. It sends the same request as "Fork with earlier messages" and then opens the new chat's normal model picker. The original chat is not changed. The picker opens only if the new chat is still the open one, so it never acts on a chat the person moved to. The change adds no model id and no model list of its own. Models come from the composer picker that every harness already uses, and a pick goes through the usual model route. There is no backend change, so the fork still keeps the parent's privacy mode. The label is in every catalog. The entry is a normal menu item: it works from the keyboard, and its text gives it its name. Tests cover the entry, the head direction, and the rule that the picker opens only on the new chat; breaking each one makes a named test fail. Non-blocking follow-ups: (1) no test covers the "Another fork is starting" line on the plain fork entry while this new fork runs; (2) the expect(opened).toBe(activeSlot() === CHILD) check in website/src/test/forkRespectsSwitchAway.test.tsx:261 passes whether the switch landed or not, so it should assert true; (3) as with "Fork with earlier messages", the entry is missing on old replies that have no message id. Decisive lines: website/src/pages/chat/AssistantMessage.tsx:663, website/src/pages/chat/page/transcriptRendering.tsx:235, website/src/pages/useChatPageSlotSwitches.ts:84

@bolichen97

Copy link
Copy Markdown
Contributor Author
  • span=38644d4f5240 New model-fork action is inaccessible on legacy replies

Rebutted: on a reply with no message id forkItemsInMenu is false (AssistantMessage.tsx:433), so fork is the row button (forkRow, :453) and no fork entry sits in More. "Fork with earlier messages" (:645) is hidden on exactly those replies; "Fork with another model" (:668) follows the same placement.
Nothing is lost there: the row button still forks, and the new chat's own model picker changes the model.
Showing the entry on those replies means opening a More menu on footers that have none today and moving fork out of the row. That is a placement change the frozen goal (one menu action beside the existing fork entries) does not cover. The adjudication downgraded it for the same reason.

[operator: bolichen97]

@bolichen97

Copy link
Copy Markdown
Contributor Author

[operator: bolichen97] The red backend checks on this head are main's, not this PR's (the PR changes only website/ and docs/):

Today's main has two other backend reds (#35660: test_wait_discipline_ratchet and test_updates_handlers_facade), with fixes open in #35625 and #35614. A rebase now would only swap one main red for another, so this PR waits for those two to merge, then rebases once onto main and re-runs CI.

@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/decisions/README.md, docs/system-specs/modules/history.md, website/src/pages/chat/AssistantMessage.tsx, website/src/pages/chat/page/transcriptRendering.tsx, website/src/test/AssistantMessage.test.tsx and the website/src/i18n catalogs since this head's CI ran (ee7a026 -> 2f7e9f2); CI re-running.

The new base carries the fixes for the main reds the previous head failed on: TestRewriter in Backend Tests shard 8 (#35541, #35547) and TestAmiArchitectureCheck (#35746). The rebase took AssistantMessage.test.tsx past 1,600 lines, so this PR's two menu tests moved to website/src/test/AssistantMessage.forkWithModel.test.tsx, unchanged. Main also changed the More menu (Quote is listed there only when the row lacks it), so all five screenshots were re-captured from the new head.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention and removed readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running labels Nov 12, 2026
Asking a second model the same question took a fork, a model change in
the new chat and a retyped prompt. A reply's More menu now offers "Fork
with another model": it forks with the earlier messages and then opens
the new chat's own model picker, so the model and its effort are picked
in the one combined control and go through the same route as any pick.
The picker opens only when the new chat is the open one once the switch
lands. The fork request, /fork and the agent fork are unchanged.

Records the maintainer decision as a docs/decisions entry and documents
the entry beside the fork paragraphs of the history spec.

Closes #35226
@bolichen97
bolichen97 force-pushed the fix/35226-fork-with-another-model branch from 9fdbb18 to e741856 Compare November 12, 2026 20:25
@bolichen97

Copy link
Copy Markdown
Contributor Author

Rebased: main moved in docs/decisions/README.md, docs/system-specs/modules/history.md, website/src/pages/chat/AssistantMessage.tsx, website/src/pages/useChatPageSlotSwitches.ts and the website/src/i18n catalogs since this head's CI ran (2f7e9f2 -> d9839ee); CI re-running.

The new base carries #35705, the fix for the one red the previous head failed on: test_a_ledger_the_emitter_itself_opened_is_still_removed in Backend Tests shard 6 (tracked in #34376), which this PR does not touch. This PR's own change is unchanged. Main's edits to the two shared source files are in other functions (the turn-cache footer note, and the signed-link handler), not the fork menu or the model picker, so the screenshots still show this head.

[operator: bolichen97]

@github-actions github-actions Bot added readiness: checking Automated validation is still running and removed readiness: action required A blocking check or review needs attention labels Nov 12, 2026

@buluoray buluoray left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approve on e741856. This head is a rebase of b66bfc6, which we approved, with the PR's two menu tests moved into a file of their own. No product code of the PR changed, and the two moved tests carry the same bodies and the same checks. What we checked still holds. This adds "Fork with another model" to a reply's More menu. It sends the same request as "Fork with earlier messages" and then opens the new chat's normal model picker. The original chat is not changed. The picker opens only if the new chat is still the open one, so it never acts on a chat the person moved to. The change adds no model id and no model list of its own. Models come from the composer picker that every harness already uses, and a pick goes through the usual model route. There is no backend change, so the fork still keeps the parent's privacy mode. The label is in every catalog. The entry is a normal menu item: it works from the keyboard, and its text gives it its name. Tests cover the entry, the head direction, and the rule that the picker opens only on the new chat. Every check on this head is green. Non-blocking follow-ups, unchanged: no test covers the "Another fork is starting" line on the plain fork entry while this new fork runs; one check in website/src/test/forkRespectsSwitchAway.test.tsx passes whether the switch landed or not, so it should assert true; and, as with "Fork with earlier messages", the entry is missing on old replies that have no message id. Decisive lines: website/src/pages/chat/AssistantMessage.tsx:670, website/src/pages/chat/page/transcriptRendering.tsx:238, website/src/pages/useChatPageSlotSwitches.ts:84

@github-actions github-actions Bot removed the readiness: checking Automated validation is still running label Nov 12, 2026
@github-actions github-actions Bot added the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 2026
@bolichen97
bolichen97 merged commit c90518e into main Nov 12, 2026
99 checks passed
@bolichen97
bolichen97 deleted the fix/35226-fork-with-another-model branch November 12, 2026 21:25
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Nov 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fork a chat onto another model, so the same prompt can be asked of a second model

3 participants