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 — V1→V2 migration: one off-format message ID aborts it; migrated sessions stay invisible (stale project_id + path) · Issue #55663 · anomalyco/opencode

V1→V2 migration: one off-format message ID aborts it; migrated sessions stay invisible (stale project_id + path) #55663

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
V1→V2 migration: one off-format message ID aborts it; migrated sessions stay invisible (stale project_id + path)#55663
Copy link
Labels
pending closetriaging

Description

@marcello-russo
marcello-russo
opened on Oct 15, 2026
Issue body actions

Summary

After upgrading to 2.0.29, all pre-upgrade sessions disappeared from the TUI picker. Nothing was lost — three separate migration defects combined to hide them:

  1. A single off-format message ID aborts the whole V1 migration. One row with id='msg-init1' (hyphen instead of msg_...) failed schema validation (Session.Message.ID must start with "msg_") and stopped the migration after ~52 of 3681 sessions.
  2. Migrated sessions keep project_id='global'. The TUI session list filters by the current project (project + subpath params, see packages/tui/src/component/dialog-session-list.tsx), so migrated sessions never match.
  3. Migrated sessions keep the stale path (subpath relative to the old / worktree, e.g. home/user/project) while the TUI requests subpath=''. Zero matches even after fixing (2).

Environment

  • opencode 2.0.29, Linux, background service
  • DB: 12 GB, 3681 V1 sessions / 248k messages / 943k parts

Evidence

  • Log: level=ERROR ... message="V1 migration failed" cause="...Session.Message.ID..." (full trace in guide)
  • SELECT id FROM message WHERE id NOT GLOB 'msg_*'; → exactly one row: msg-init1
  • GET /api/session?project=<id>&subpath= returned 1 session before the fix, old sessions after
  • GET /api/experimental/migration/v1 → {"status":"completed"} only after fixing (1)

Workaround applied (verified)

  1. Renamed the offender to msg_init1 (+ its part.message_id refs), restarted service → migration completed.
  2. Remapped session_v2.project_id from global to the per-directory project (760 rows).
  3. Reset session_v2.path='' where directory == project worktree (798 rows).

Full step-by-step guide (diagnosis queries, rollback notes): https://gist.github.com/marcello-russo/0b3bd4872a9eac4b0c31ebf7dc332c01

Suggested fix

  • Migration should skip-and-log (or auto-normalize) rows failing ID validation instead of aborting.
  • Migration should remap project_id to the per-directory project and recompute path relative to it, so migrated sessions are visible without manual DB edits.

Activity

  1. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 15, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for the detailed write-up and the verified workaround guide!

    I think this is a duplicate of existing reports: it combines two known problems, mainly #54736 for the aborted migration and #49827 for the hidden sessions. Possible duplicates and related issues, ordered by likelihood:

    • migration: V1 migration aborts on legacy message ID failing Session.Message.ID schema #54736: same error (Session.Message.ID must start with "msg_"). One legacy V1 message ID without the msg_ prefix aborts the whole V1 migration instead of being skipped or fixed. It has been reproduced on 2.0.27 and on the latest dev.
    • migrate-v1: non-git sessions in "global" project hidden after V1→V2 upgrade #49827: migrated V1 sessions keep project_id = 'global' while V2 creates a project for each directory, so the session picker hides them.
    • V1→V2 importer keeps project_id='global' for non-git directories, so migrated sessions never appear in the per-directory session picker #50551: same root cause as migrate-v1: non-git sessions in "global" project hidden after V1→V2 upgrade #49827. A comment there also notes that fixing project_id alone is not enough and path has to be reset too, which matches your point 3.
    • db migration: v1→v2 leaves pre-upgrade sessions invisible in session list (project_id/path not remapped) #55381 / session: V1 sessions in non-git directories hidden after V2 migration (project_id stays 'global') #55633: recent 2.0.29 reports of the same hidden-session problem.
    • fix(core): attribute migrated V1 sessions to the project of their directory #51935 (open PR): changes the migration to assign global sessions to the project of their directory and recompute path. It also repairs databases that were already migrated.

    Your numbers (one bad ID stopping the import after about 52 of 3681 sessions, plus 760 and 798 remapped rows) and your gist would be useful as comments on #54736 and #49827.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different.

  2. opencode-agent
    added
    pending close
    triaging
    on Oct 15, 2026
  3. marcello-russo commented on Oct 15, 2026

    @marcello-russo
    marcello-russo
    on Oct 15, 2026
    Author
    More actions

    Confirmed duplicate — evidence and recovery steps posted on #54736 (migration abort) and #49827 (hidden sessions, incl. the stale-path finding). Closing this one; tracking continues there and on PR #51935.

  4. marcello-russo
    closed this as completedon Oct 15, 2026
  5. opencode-agent commented on Oct 15, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 15, 2026 – with OpenCode Agent
    Contributor
    More actions

    Thanks for confirming, and for posting your evidence and recovery steps on #54736 and #49827. Follow those two issues and PR #51935 for progress. This issue will be closed as a duplicate.

  6. opencode-agent
    closed this as duplicateon Oct 16, 2026
  7. opencode-agent commented on Oct 16, 2026

    @opencode-agent
    opencode-agentBot
    on Oct 16, 2026 – with OpenCode Agent
    Contributor
    More actions

    Closing as a duplicate, as you confirmed. The aborted migration is tracked in #54736, the hidden sessions (project_id and the stale path) in #49827, and PR #51935 has the proposed fix for the hidden sessions. Thanks again for the detailed diagnosis and for adding your evidence there.

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

    pending closetriaging

    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.