Skip to content

[FEATURE]: continue a session on another opencode instance when the server is unreachable, and bring the continuation back as a fork #52801

Closed as not planned

Description

@Skeptomenos

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

Let a session move between opencode instances and come back: work on a session served by a remote opencode serve, continue it on a local instance while that server is unreachable, and return the local continuation to the server when it is reachable again.

The use case. Each user's sessions live on their own remote opencode serve, and a desktop client talks to it. When the laptop loses the connection to that server, the user wants to keep working in the same session with a local opencode instance. When the connection is back, the work done offline should land on the server, without losing anything that happened there in the meantime (for example, a run that finished on the server).

What v2.0.20 already has, which gets most of the way:

  • SessionTransfer (packages/core/src/session/transfer.ts): export a session's info and settled messages; import them into another instance. The CLI's session export and session import use it, and the import goes through POST /api/experimental/session/import.
  • Fork metadata on a session: fork: { sessionID, boundary } (packages/core/src/session/info.ts), and a session.forked event.

What is missing for this use case:

  1. Import as a fork. Import the messages after a boundary as a new session, forked from an existing session at that boundary, so the lineage is kept. Today import keeps the session id and refuses an existing one with 409 (cli: V2 session import fails when the session ID already exists #48335); fix(core): copy imported sessions on ID collision #48336 would import a detached copy with fresh ids instead.
  2. Incremental export. Export only the messages after a given message id, so a client can keep a local mirror and ship only the difference.
  3. A stable route for export and import. Today export runs through the CLI, which boots a full project instance ([FEATURE]: run export/import without booting a project instance #42490), and import is under /api/experimental.
  4. Optional: a public route to create a fork at a boundary, without importing.

With 1 and 2, returning offline work never needs a merge: the offline part becomes a fork of the server's session at the last message both sides had.

Related, not duplicates:

Is cross-device session continuity on your roadmap? If it is, we are glad to follow your design rather than build our own on top.

Activity

  1. github-actions commented on Oct 2, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    • #38011: requests syncing chat session contents across devices.
    • #38411: reports sessions not syncing between devices connected to the same server.

    These cover related cross-device session-sync needs; this issue adds offline continuation between instances and returning the work as a fork.

  2. opencodejr commented on Oct 27, 2026

    @opencodejr
    Contributor

    Thanks for the detailed write-up, @Skeptomenos!

    To restate the request: let a session served by a remote opencode serve be continued on a local instance while the server is unreachable, then sent back as a fork of the server's session at the last shared message. Building blocks:

    1. Import as a fork at a boundary.
    2. Incremental export of messages after a given id.
    3. Stable, non-experimental export and import routes.
    4. Optionally, a public route to create a fork at a boundary.

    Today SessionTransfer.import keeps the exported session id and refuses an existing one, and export always returns the full settled transcript. So this needs new behaviour rather than a bug fix. It also can't be done as a plugin, because import and fork creation happen inside core and plugins can't add server routes.

    Maintainers will consider it, including your question about whether cross-device continuity is on the roadmap. I can't promise anything.

    Related issues:

  3. neriousy commented on Nov 12, 2026

    @neriousy
    Member

    Thanks for the suggestion. This isn't something we plan to build, so closing to keep the tracker focused.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions