You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Add "Fork to new session" action from message timeline in OpenCode Desktop #25582
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:
Open a session with at least one user+assistant turn.
Click "Fork to new session" on a user message.
Confirm route changes to the new session.
Confirm sidebar highlights the new session.
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.
This issue might be a duplicate of existing issues. Please check:
Frok to new session doesnt work on Opencode Desktop #18687: "Fork to new session" on OpenCode Desktop on Windows doesn't work — reports the same feature area (message-level fork action in desktop app), though as a bug rather than a feature request
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.
Frok to new session doesnt work on Opencode Desktop #18687: "Fork to new session" on OpenCode Desktop on Windows doesn't work — reports the same feature area (message-level fork action in desktop app), though as a bug rather than a feature request
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.
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.
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:
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.
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?
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.
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.
Activity
github-actions commentedon May 3, 2026
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.
adrian15 commentedon May 3, 2026
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
/duplicatein 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.
adrian15 commentedon May 9, 2026
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:

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.
adrian15 commentedon May 9, 2026
So... this is how it looks like after updating my PR:
So... Do you think this is the right way of adding the button from design point of view?
Thank you for your feedback.
fengmazi commentedon May 11, 2026
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?
adrian15 commentedon May 11, 2026
No.
Right.
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.
scvnathan commentedon May 16, 2026
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.
aniongithub commentedon May 23, 2026
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.
github-actions commentedon Jul 23, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
MaciejGorczyca commentedon Aug 16, 2026
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)