anomalyco / anomalyco/opencode
app: /fork dialog only lists currently loaded messages
@Hona is already working on this.
Since Aug 26, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
In the desktop app, /fork opens “Fork from message” with a list of user prompts from the current session. That list is not the full session. It only shows whatever is already in the client message cache.
If I stay in a session from the first turn to the last, the dialog has every turn. After I restart the app and open the same session, it only has the latest turns. If I scroll the timeline all the way to the top and open /fork again, the missing turns come back.
The dialog reads data.session.message.list(). That store is paged: first sync loads the newest 20 messages, and older pages are fetched only when the timeline scrolls up (loadMore). Fork is a separate picker, so it should not depend on how far I have scrolled.
I would like to fix this. Suggested approach: when the dialog opens, fetch the session’s user messages itself (same idea as session export) and search/select against that list. Do not drain the timeline cache just to populate the picker. If the selected message is not in the timeline store, use the fetched copy instead of data.session.message.get().
Other options: keep calling loadMore until the timeline cache is complete, or add a dedicated fork-points API. I think the first of those couples the dialog to timeline paging, and the second is more than this bug needs.
TUI’s fork dialog uses the same list() store, so it may have the same gap.
Plugins
none related
OpenCode version
desktop beta (current dev / V2)
Steps to reproduce
- Start a session with at least 3–4 user turns and leave it without restarting.
- Run
/fork. The dialog lists every turn. - Quit and reopen the desktop app, then open the same session (stay at the bottom).
- Run
/forkagain. Only the latest turns are listed. - Scroll the timeline to the first message, then run
/forkagain. The earlier turns reappear.
Screenshot and/or share link
I'll attach before/after screenshots shortly (full list vs latest turns only).
Operating System
macOS
Terminal
n/a (desktop app)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.