Skip to content

cli: migrated v1 sessions from non-git dirs missing from session list #52919

Closed as duplicate

Description

@vibe-maribit

Description

Migrated v1 sessions are missing from the project-scoped session list when their directory is not a git repo.

After upgrading from V1 (1.14.32-1.18.32) to 2.0.22, the data migration reports completed and no data is lost, but sessions created in non-git directories keep the V1 project_id = "global". V2 scopes /sessions and opencode session list to the current project, and V2 creates a separate project entry for that same directory, so those sessions get filtered out.

Affected in my case: 30 of 37 migrated sessions (/home/nicola 23, ~/blender 6, ~/trading 1). Sessions from git repos (salon-bot, TradingAgents, transpotec) are unaffected and list normally, so this looks specific to the global project id.

Workaround: transcripts are intact and reachable via Ctrl+O (recent sessions and projects) or opencode -s <sessionID>.

Expected: either the migration should re-map project_id from the stored session_v2.directory/path, or the project-scoped list should include global-project sessions whose directory matches the current location.

Plugins

none

OpenCode version

2.0.22 (channel: latest), upgraded from v1 1.14.32-1.18.32

Steps to reproduce

  1. In V1 (1.14.x-1.18.x), run OpenCode from a directory that is not a git repo and create a few sessions.
  2. Upgrade to V2 (2.0.22) and start it once so the data migration completes.
  3. opencode api get /api/experimental/migration/v1 -> {"status":"completed"}
  4. cd into that same directory and run opencode session list -> only sessions created after the upgrade are listed, the v1 ones are missing.
  5. opencode api get "/api/session?limit=100&directory=<that directory>" -> the v1 sessions are returned.
  6. Read-only DB check: SELECT project_id, count(*) FROM session_v2 GROUP BY project_id -> the v1 sessions are counted under global.

Also note: in step 4, pressing Ctrl+O in the TUI does show them, so the sessions are reachable but not listed in the normal session view.

Screenshot and/or share link

No response

Operating System

Linux Mint 22.3 (Linux 6.8.0-111-generic)

Terminal

unknown terminal app (TERM=xterm-256color, COLORTERM=truecolor)

Activity

  1. github-actions commented on Oct 3, 2026

    @github-actions
    Contributor

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

    • #50800: V1 sessions from non-git directories remain in the legacy catch-all project and are missing from project-scoped lists.
    • #50551: The V1→V2 importer keeps project_id = "global" for non-git sessions, hiding them from the per-directory picker.
    • #51176: Migrated V1 global sessions are hidden from V2 session lists.
    • #49827: Non-git sessions in the global project become hidden after upgrading.

    For keybind-related issues, please also check our pinned keybinds documentation: #4997

  2. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the clear report and the comparison with Git-backed directories — this is the same problem as #49827, where we're tracking migrated sessions hidden under the old global project. Please subscribe or add a 👍 there, and feel free to add your version and Linux Mint details.

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