Skip to content

Conversation

ferenci84
Copy link
Contributor

@ferenci84 ferenci84 commented Sep 5, 2025

Description

Based on the git history and diff, I can see you've been working on adding fork session functionality to Continue. Let me summarize the changes and provide a PR title and description.

Summary of Changes

This PR introduces new session management features that allow users to copy existing sessions and fork conversations from specific points.

This feature is an enhancement of the tabs feature.

Original issue: #4030

Features Added:

  • Copy Session: Creates a deep copy of an entire session with new message and tool call IDs to prevent reference conflicts
  • Fork Session: Creates a copy of a session up to a specified message index and opens it in a new tab
  • UI Components:
    • Added copy functionality to history table rows
    • Added fork buttons to both user and assistant message containers
    • Created a new UserMessageActions component for user message interaction options

Use Cases:

  • Users can duplicate an entire conversation for experimentation without affecting the original
  • Users can fork a conversation from any point to explore alternative paths
  • Improves workflow when users want to preserve conversation history while trying different approaches

AI Code Review

  • Team members only: AI review runs automatically when PR is opened or marked ready for review
  • Team members can also trigger a review by commenting @continue-general-review or @continue-detailed-review

Checklist

  • I've read the contributing guide
  • The relevant docs, if any, have been updated or created
  • The relevant tests, if any, have been updated or created

Screen recording or screenshot

Screenshot 2025-09-05 at 12 27 13 Screenshot 2025-09-05 at 12 27 48

Notes to the reviewer

The chosen icon may not be the best for forking. If we can use a different icon set or an SVG, we can use a better icon similar to this one: https://www.svgrepo.com/svg/327279/git-branch

I have added an limited icon set below the user messages too. This supports all these user actions:

  • The user want to send the first message with a different model (clicks the icon below the first user message)
  • The user want to send the last message with a different model (clicks the icon below the last user message)
  • The user want to continue the conversation while keeping the current chat intact (clicks the icon below the last assistant message)
  • The user want to keep the last assistant message in the current session, but want to ask a different question or send the same question to a different model (clicks the icon above last user message)

Summary by cubic

Add session copy and fork so users can duplicate conversations or branch from a specific message, with each fork opening in a new tab. This keeps originals intact and speeds up exploring alternatives.

  • New Features
    • Copy Session: deep copies a session with new message/tool-call IDs; triggered from History row “Copy”; auto-numbered titles (e.g., “Copy1 of …”) with safe truncation.
    • Fork Session: copies history up to a chosen message; accessible from both assistant and user messages via “Copy and fork from here”; saves the current session first, then opens the fork in a new active tab titled “ForkN of …”.
    • UI: added UserMessageActions (fork + copy text); added fork action to ResponseActions; always show assistant actions when appropriate; added Copy button in History rows.
    • Tabs: create and activate a new tab for forks; minor async handling fixes in TabBar.

@ferenci84 ferenci84 marked this pull request as ready for review September 5, 2025 11:16
@ferenci84 ferenci84 requested a review from a team as a code owner September 5, 2025 11:16
@ferenci84 ferenci84 requested review from tingwai and removed request for a team September 5, 2025 11:16
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Sep 5, 2025
… for finding unused titles and improve truncation handling
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant