Skip to content

[FEATURE]: Implement V2 session.fork API #34430

Description

@opencode-agent

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

Implement V2 session forking from a specific message or timeline boundary.

Current notes from #34359:

  • SessionV2.create supports parentID, but that is only one ingredient.
  • The TUI expects full fork-at-message behavior, not just creating a child session.

Expected scope:

  • Define the fork input contract, including parent session and fork boundary/message.
  • Decide which session state/history/context is copied into the fork.
  • Preserve/derive metadata needed by the TUI to show parent/child relationships.
  • Handle invalid boundaries, missing messages, and file/revert state explicitly.
  • Add protocol/server/client exposure and tests.

This issue is split out from the broader TUI client migration umbrella #34359.

Metadata

Metadata

Assignees

Labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions