anomalyco / anomalyco/opencode

cli: V2 session import fails when the session ID already exists

Open
#48,335 0 comments 0 reactions 1 assignee View on GitHub

@kitlangton is already working on this.

Since Sep 10, 2026.

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

Description

Description
  • Importing an exported V2 session into another project fails with “Session already exists” when that ID is already stored locally.
  • This also affects users sharing copies of a session between machines when the destination already has that session.
  • Expected: import an independent copy with fresh session and message IDs on collision, and report the new session ID.
  • /move can relocate an existing session, but does not create a separate copy.
Plugins
  • Not required to reproduce; covered by the core transfer tests.
OpenCode version
  • Installed: 0.0.0-beta-19425.
  • Code inspected: v2 at ae7d9f029d.
Steps to reproduce
  • Export an existing session: opencode2 export <session-id> > session.json.
  • Import it into another project using the same server: opencode2 import session.json --directory /path/to/other-project.
  • Observe “Session already exists” instead of a new imported copy.
Screenshot and/or share link
  • Not attached; CLI reports “Session already exists”.
Operating System
  • macOS, Darwin 25.6.0, arm64.
Terminal
  • TERM=xterm-256color; terminal application unavailable.

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.