Skip to content

[FEATURE]: Add "Fork to new session" action from message timeline in OpenCode Desktop #25582

Closed as not planned

Description

@adrian15

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

OpenCode App should support forking directly from a specific user message into a new session, matching existing CLI/TUI behavior.

Problem

In the app flow, users currently need to use the session fork dialog/command flow to branch from history. This is slower and less discoverable than a message-level action.

Proposed behavior

  • Add a message action button: "Fork to new session" on user messages.
  • On click, call session.fork with sessionID and messageID.
  • Navigate to the returned forked session.
  • Restore prompt content from the selected source message in the new session.
  • Use localized error handling (no hard-coded strings).

Scope

  • packages/ui: expose/render message-level fork action next to existing message actions.
  • packages/app: wire action to API, prompt scoping, navigation, and error toast.
  • Keep implementation small and focused; do not change server fork semantics in this issue.

Acceptance criteria

  • Fork action appears on user messages in app timeline.
  • Fork creates a new session from the selected message boundary.
  • New session opens immediately and is highlighted/selected in sidebar.
  • Prompt state is scoped to the new session, not the previous one.
  • Typecheck passes for affected packages.

Verification plan

  • Run bun run typecheck from packages/app.
  • Manual test:
    1. Open a session with at least one user+assistant turn.
    2. Click "Fork to new session" on a user message.
    3. Confirm route changes to the new session.
    4. Confirm sidebar highlights the new session.
    5. Confirm draft/prompt content corresponds to the selected source message.

Notes

  • This issue is intentionally app-focused and aligned with the contribution rule to keep changes small.
  • If maintainers want sibling-aware fork title increments (fork #2, fork #3), that should be tracked as a separate backend issue.

Activity

  1. github-actions commented on May 3, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    If your request is distinct from these (e.g., specifically about the UX of a per-message inline action button rather than a command), please clarify how it differs from #18118 and #18687.

  2. adrian15 commented on May 3, 2026

    @adrian15
    Author

    Yeah, that's a bug because when that issue was created apparently the feature worked as expected and it was present in the UI. It is currently not present in the UI so I treat it as a feature request.

    No, the actual purpose of the issue is to expose /duplicate in the command list even if fork workflow is mentioned in the issue.

    Yes, this one is somewhat related but it has more focus on being able to fork from the 'ai message' instead of the 'user message'. Also that issue is TUI specific while mine is adding already existing TUI functionality to the OpenCode Desktop.

    Yeah, so, apparently this feature existed back in the day in the OpenCode Desktop so I'm not sure if I'm actually fixing a regression here.

  3. adrian15 commented on May 9, 2026

    @adrian15
    Author

    So I guess that, after reading more carefully the contribution guidelines I should sort of convert this issue into a Design conversation.

    I have just noticed that according to video from: #18687 :

    20260323-0137-06.3748532.mp4

    the 'Fork to new session' icon was shown to very left and my implementation from my associated pull request (see screenshot below) is having the button centered between revert button and copy button.

    The new Fork the new session option:
    imagen

    The 'Fork to new session' button being centered could lead to some errors as a consequence of muscle memory trying to trigger the revert button.

    So... I think I should be putting the icon to the very left as the video above suggests.

    Any feedback about it?

    In the meantime I will updating the associated PR with this improvement.

  4. adrian15 commented on May 9, 2026

    @adrian15
    Author

    So... I think I should be putting the icon to the very left as the video above suggests.

    So... this is how it looks like after updating my PR:

    Image

    So... Do you think this is the right way of adding the button from design point of view?

    Thank you for your feedback.

  5. fengmazi commented on May 11, 2026

    @fengmazi

    Can this function be used on the desktop version now? I have updated to the latest version, but there is no corresponding button. Do I need to wait for a version update or configure it to enable it?

  6. adrian15 commented on May 11, 2026

    @adrian15
    Author

    Can this function be used on the desktop version now?

    No.

    I have updated to the latest version, but there is no corresponding button.

    Right.

    Do I need to wait for a version update or configure it to enable it?

    Well, what you are seeing here is a feature request. That means that I request OpenCode to add this new functionality. Before this goes onto a new release it has to discussed, reviewed and approved by OpenCode collaborators.
    Then it's merged onto the dev branch and later on it's released.

    For now I haven't received human feedback on this issue or its associated feature request.

    You can try to bump the issue by clicking on the first message with a heart or thumbs up reaction so that interest on the feature is concentrated in one single place. Your comment has also been useful for making the issue stand in the eyes of the reviewers.

    Alternatively you can build your own OpenCode with this fix and use that.

  7. scvnathan commented on May 16, 2026

    @scvnathan

    Yeah, so, apparently this feature existed back in the day in the OpenCode Desktop so I'm not sure if I'm actually fixing a regression here.

    I don't think it's a regression. Based on the commit message, it looks like it was deliberately removed in v1.3.4, in this commit. Kinda weird it was removed with no explanation. I found it handy.

  8. aniongithub commented on May 23, 2026

    @aniongithub

    Any explanation on why this was removed? I am running into issues where I can't fork a session or compact it. This is very frustrating.

  9. github-actions commented on Jul 23, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  10. MaciejGorczyca commented on Aug 16, 2026

    @MaciejGorczyca

    I made a bat script that can fork any message from any session before this is addressed and added to the UI itself.

    #8689 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions