Forking lets you take a conversation in a new direction without losing the original. Until now it cloned the entire transcript no matter which reply you forked from, so branching off an earlier point still dragged every later message along. This update makes forking behave like a real branch and makes the branch relationship visible in the chat itself.
Forks End Where You Branch
The fork button on each Keating reply now creates a session that ends right after that reply's turn. Everything after the branch point — the next question and all that followed it — is left behind in the original, giving you a clean, continuable starting point. The reply's tool results are kept with it, so the branched conversation stays coherent when you pick it back up.
Because the chat folds tool results and merges consecutive assistant turns before rendering, the displayed position can't be mapped straight back to stored messages. The truncation is anchored on the forked reply's timestamp instead, in a small pure helper truncateAtForkPoint in session-metadata.ts. If a timestamp ever fails to match, it safely falls back to keeping the full conversation. Forking a whole past session from the sidebar is unchanged — that branch point is simply the end of the session.
A Clear Fork Indicator
When the active session is a fork, a slim banner now sits under the chat header reading Forked from "" with an Open original button to jump back to the parent in one click. The banner is a standalone ForkBanner component, and it clears itself when you start a new session so it only ever shows when you are genuinely inside a branch.
Tested and Storied
The branch-point logic ships with unit tests covering the cases that matter: ending after the forked turn, keeping that turn's tool results, matching merged assistant turns, forking the final reply, and the no-match fallback. The project also gained a Storybook setup so isolated UI pieces like ForkBanner can be developed and reviewed on their own, including a long-title story that verifies the banner truncates gracefully.