Skip to content

feat(app): add a Full session row to the /fork picker - #67731

Merged
Brendonovich merged 2 commits into
devfrom
app-fork-full-session
Dec 2, 2026
Merged

Brendonovich merged 2 commits into
devfrom
app-fork-full-session

Conversation

@opencode-agent

@opencode-agent opencode-agent Bot commented Dec 2, 2026 •

Copy link
Copy Markdown
Contributor

Issue for this PR

Closes #67147

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

Adds a Full session row at the top of the desktop/web /fork picker, in the same place the TUI has it. Choosing it calls session.fork without before, so the fork copies the whole history, including the latest assistant reply, and opens with an empty composer. Forking before a prompt works as it did before.

  • fork-machine.ts: a fork now carries a SessionForkBoundary, either { type: "full" } or { type: "before", messageID, draft }. fork.start sends before only for a prompt fork, fork.open restores a draft only when there is one, and the view reports which target is pending.
  • fork.ts: fork({ sessionID, target }) builds the draft only for a before target. useSessionFork (the timeline's "Fork from here") still forks before its message.
  • fork-dialog.tsx: "Full session" goes above the prompts (newest first) when the session has any. A bare Enter now forks the full session, the same as in the TUI. The row can be found by search, and it shows a spinner while its fork runs.
  • en.ts: adds dialog.fork.full.

How did you verify your code works?

  • bun test src/session/fork-machine.test.ts: added a full-session case that checks before: undefined, the pending view and that fork.open has no draft.
  • e2e composer.spec.ts: the existing /fork test now checks that "Full session" is the first row and moves to the newest prompt with ArrowDown before Enter. A new test checks that a bare Enter forks with no before, opens the fork and leaves its composer empty. Both tests pass locally on Chromium.
  • bun run typecheck in packages/app passes. typecheck:e2e shows only errors that are already on dev, none of them in the lines this PR touches.
  • lint:changed passes in CI. oxlint crashes in the sandbox this was written in, so it couldn't run locally.

Screenshots / recordings

Screenshots are in the Slack thread this PR came from.

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

Requested by: Brendan via Slack

@opencodejr opencodejr Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. I ran it in Desktop with the simulated model. On the base, /fork lists only prompts, and Enter forks before the newest one, which drops its reply and puts the prompt back in the composer. With this PR, Full session is the first row and is highlighted. A bare Enter opens a fork that includes the latest assistant reply, and the composer is empty. fork-machine.test.ts passes and tsc -b in packages/app is clean.

Public API: unchanged. The change only touches packages/app internals and calls the existing session.fork without before.

No blocking concerns. The bare Enter in the picker now forks the full session instead of the newest prompt. That matches the TUI and #67147.

Before

After

@Brendonovich
Brendonovich merged commit 8b3bb7d into dev Dec 2, 2026
12 checks passed
@Brendonovich
Brendonovich deleted the app-fork-full-session branch December 2, 2026 08:32
@amrkmn amrkmn mentioned this pull request Dec 3, 2026
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

desktop: /fork dialog has no full-session option

1 participant