anomalyco / anomalyco/opencode

[FEATURE] Session tree: branch history, rollback-and-continue from any message, branch navigation (like Pi)

Open
#41,363 3 comments 0 reactions 1 assignee View on GitHub

@nexxeln is already working on this.

Since Aug 9, 2026.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Feature request

Pi (earendil-works) has tree-shaped session history: you can go back to any earlier point in the conversation, fork a new branch there, and navigate the branches like a git history. OpenCode only has a single-level fork/compact — no way to revisit earlier states of the same session.

What I'd like

In the Desktop app (and TUI):

  1. Session timeline / tree view: every fork creates a branch; you can see the whole tree of a session (like a git graph).
  2. Rollback to any node: select any earlier message → "continue from here" creates a child branch without losing the current branch (i.e., an explicit fork at any point, not just at continue).
  3. Branch navigation: switch between branches of the same session, diff summaries between branches.
  4. Visualization: sidebar tab "History/Timeline" in desktop app.

Why

  • Current behavior: --fork / fork in desktop clones the whole session; you cannot see where in the conversation the fork happened, and multiple alternative explorations quickly become unmanageable (100+ sessions).
  • For debugging AI workflows (try idea A, try idea B from the same point, compare) it's the single most effective pattern.
  • Pi has shown the UX; OpenCode has the storage (messages are already stored) — mainly a UI + routing change.

Related

  • #34430 (closed: V2 session.fork API) — the API exists; this is the user-facing tree UI.
  • #38558 (session.generate contract) — relevant to how branches export.

Proposal

  • Treat every session as a DAG/branch tree in storage (parent_id on messages).
  • Add /tree slash command or sidebar tab: shows branch nodes, lets you jump/continue.
  • --fork becomes "create branch at latest message", new --fork <msg-id> to fork at any message.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.