GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — migration: v1 sessions imported under project 'global' are invisible in project session lists · Issue #50999 · anomalyco/opencode

migration: v1 sessions imported under project 'global' are invisible in project session lists #50999

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
migration: v1 sessions imported under project 'global' are invisible in project session lists#50999
Copy link

Description

@lmt3312
lmt3312
opened on Sep 23, 2026
Issue body actions

Description

Summary

The v1→v2 session import runs and reports completed, but every imported v1
session is assigned project_id='global' (the catch-all project with path /)
instead of the project matching the session's preserved directory. Clients
list sessions scoped to a project, so the entire v1 history becomes invisible
after the upgrade even though the data is fully intact in the database.

Environment

  • opencode version: 2.0.15 (upgraded from 1.18.31)
  • OS: Linux 6.6.114.1-microsoft-standard-WSL2 x86_64
  • Terminal: TERM_PROGRAM=vscode, TERM=xterm-256color, COLORTERM=truecolor
  • Shell: bash
  • Install/channel: release (v2 installed via bun; v1 previously via the curl install script)
  • Active plugins: oh-my-opencode-slim (unrelated — the behavior is server-side data placement)

Reproduction

  1. Use opencode v1 (1.18.x) with session history across several distinct project directories.
  2. Upgrade to v2 and start it once. The import runs: KV gains
    migration.v1-v2 = {"phase":"completed"}, and
    GET /api/experimental/migration/v1 returns {"status":"completed"}.
  3. Open the TUI in any of the former project directories and list sessions
    (<leader>l or ctrl+o).

Expected Behavior

Imported v1 sessions appear in the session list of the project/directory they
originally belonged to.

Actual Behavior

  • All v1 sessions are imported with intact data: present in session_v2 /
    session_message, with correct directory, subpath, and original v1
    version strings (e.g. 1.18.x).
  • But every imported row carries project_id='global'. No project rows are
    created or resolved for the original directories.
  • Project-scoped listings (GET /api/session?project=<id>) therefore return
    only post-upgrade sessions. From the affected installation (paths
    anonymized): 97 imported v1 sessions spread across 5 distinct original
    directories (largest: 41 sessions).
    • GET /api/session?project=<projectA> → 0 imported sessions
    • GET /api/session?directory=<projectA> → 41 (all with projectID: global)
    • GET /api/session?project=global → 97
  • The migration reports completed with no indication that sessions are
    unreachable from their recorded directories.

Frequency: consistent — every project directory, every start.

Additional Context

  • Verified workaround: POST /api/session/{sessionID}/move with body
    {"directory":"<original directory>"} re-associates a session and
    auto-creates the target project row. Batch-moving 53 sessions this way made
    them immediately visible in project-scoped lists. Note that
    PATCH /api/session/{id} only supports title/metadata/permissions, so
    move is the only API path.
  • Minor related observation: the first move call shortly after service start
    was a silent no-op (empty response, exit 0, no change); the identical call
    retried a few minutes later succeeded.
  • Suggestion: have the importer resolve each session's directory to its
    project (creating it if needed, exactly as move already does).
    Alternatively, include global-project sessions whose directory falls
    under the requested location in project-scoped lists. At minimum, avoid
    reporting completed while imported sessions remain unreachable.
  • The migrate-v1 docs page does not mention session-history import or this
    global-project placement.
  • Reporter's network could not reach GitHub to search for duplicates or
    cross-reference the recent v1 session-import migration change; maintainers
    may want to cross-check against that work.

Activity

  1. lmt3312
    closed this as completedon Sep 23, 2026
  2. lmt3312
    reopened this on Sep 23, 2026
  3. lmt3312
    closed this as completedon Sep 23, 2026
  4. lmt3312
    reopened this on Sep 23, 2026
  5. neriousy
    marked session: v1 "global" sessions stay unattributed after migration and are hidden from v2's session list #51176 as a duplicate of this issue on Oct 20, 2026
  6. neriousy commented on Oct 20, 2026

    @neriousy
    neriousy
    on Oct 20, 2026
    Member
    More actions

    Thanks for documenting the database checks and recovery steps — this is the same problem as #49827, where we're tracking imported sessions remaining under the old global project. Please subscribe or add a 👍 there, and your observation about the first move request doing nothing would be worth adding too.

  7. neriousy
    closed this as a duplicateof migrate-v1: non-git sessions in "global" project hidden after V1→V2 upgrade #49827 on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    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

      You are visitor 01402775 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.