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 — desktop: sessions created on 1.19.4 don't appear after upgrading to 2.2.x (12 sessions orphaned in the v1 schema) · Issue #60773 · anomalyco/opencode

desktop: sessions created on 1.19.4 don't appear after upgrading to 2.2.x (12 sessions orphaned in the v1 schema) #60773

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
desktop: sessions created on 1.19.4 don't appear after upgrading to 2.2.x (12 sessions orphaned in the v1 schema)#60773
Copy link
Labels
pending closetriaging

Description

@Franc-st
Franc-st
opened on Oct 31, 2026
Issue body actions

Summary

After upgrading OpenCode Desktop to 2.2.x, 12 sessions created between 2026-10-21 and 2026-10-27 no longer appear in the session list or in search, with no error, warning, or log entry. The sessions are fully intact in the local database (2,240 messages, ~86 MB) — they are simply not shown.

This looks like a one-way migration gap: the v1 → v2 data migration ran once and was marked complete, but sessions created afterward under 1.19.3/1.19.4 were written only to the legacy schema and never projected into the new one.

Environment

  • OpenCode: 2.2.5 (Desktop, Electron)
  • OS: Windows
  • Plugins: none
  • Database: default data directory (opencode.db)

Root cause (diagnosis)

  1. The v1 → v2 data migration is tracked by kv['migration.v1-v2'], which is set to {"phase":"completed"} (time_updated 2026-10-19 11:52).
  2. At that time, the 36 sessions that existed were migrated.
  3. Sessions created afterward under versions 1.19.3 and 1.19.4 were written only to the legacy tables (session / message / part).
  4. On 2.2.x the UI reads only the new schema (session_v2 / session_message / session_part). Because the migration flag is still "completed", those 12 sessions are never reconciled, so they become invisible.

Evidence:

  • 12 sessions (10 created on 1.19.4, 2 on 1.19.3) have 0 rows in session_v2, session_message, and session_part.
  • The 36 visible sessions are fully projected into session_message.
  • The 2.2.x build references session_v2/session_message and the migration.v1-v2 key.

Verification query (returns 12 rows on the affected machine):

SELECT s.id, s.version, s.title
FROM session s
WHERE NOT EXISTS (SELECT 1 FROM session_v2 v WHERE v.id = s.id)
ORDER BY s.time_created;

Integrity checks on the database pass (quick_check ok, integrity_check ok, foreign_key_check 0 rows), and the orphaned sessions export cleanly from message + part.

Expected Behavior

All sessions should appear in the UI regardless of the client version that created them. Upgrading should not hide any session.

Actual Behavior

Sessions created under 1.19.3/1.19.4 after the one-time v1 → v2 migration remain invisible in 2.2.x, with no notice.

Proposed Fix

  1. Run an idempotent backfill at startup that projects any session with no matching session_v2 row (and its message/part data) into the v2 schema.
  2. Reconcile by comparing ID sets rather than relying only on the "completed" migration flag.
  3. Log how many sessions were migrated/skipped.
  4. Warn in the UI when orphaned sessions are detected instead of hiding them silently.

Additional Context

  • The affected content is preserved and exportable from the legacy tables, so this is a visibility/migration issue, not data loss.
  • Reported with personal identifiers removed.

Activity

  1. opencodejr commented on Oct 31, 2026

    @opencodejr
    opencodejrBot
    on Oct 31, 2026
    Contributor
    More actions

    Thanks for the detailed diagnosis and the verification query, @Franc-st.

    I think this is a duplicate of #50130. The V1→V2 import runs only once. When it finishes, kv['migration.v1-v2'] is set to {"phase":"completed"} and the import never runs again. Sessions a V1 client (such as 1.19.3/1.19.4) writes to the same opencode.db after that stay in the legacy session / message / part tables and are not visible in 2.x. That issue has been reproduced, and other users have posted recovery steps in its comments.

    Possible duplicates and closely related issues, most likely first:

    • server: V1 sessions created after migration.v1-v2 completes are never imported #50130: V1 sessions created after migration.v1-v2 completes are never imported (same root cause)
    • migration: V1 1.19.4 sessions not migrated to session_v2 #59517: V1 1.19.4 sessions not migrated to session_v2 (same symptom on Windows, already marked as a duplicate of server: V1 sessions created after migration.v1-v2 completes are never imported #50130)
    • session: migrated session missing messages written after V1→V2 migration; export truncated #57000: messages written by V1 to an already-migrated session after the migration are missing
    • fix(core): import V1 sessions created after migration completes #54272 / fix(core): append V1 messages written after the migration completed #57080 / fix(core): repair V1 global sessions left by completed imports #58846: proposed fixes to import V1 sessions and messages created after the migration completed
    • migration: make V1 to V2 an explicit one-way cutover #60083: proposal to make V1→V2 an explicit one-way cutover

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

  2. opencodejr
    added
    pending close
    triaging
    on Oct 31, 2026
  3. opencodejr commented on Nov 1, 2026

    @opencodejr
    opencodejrBot
    on Nov 1, 2026
    Contributor
    More actions

    We haven't heard back, so I'm closing this as a duplicate of #50130. Sessions that 1.19.3/1.19.4 wrote to opencode.db after migration.v1-v2 was marked completed are never imported into session_v2. Please follow #50130 for updates, along with the proposed fixes in #54272, #57080 and #58846. Users there have also posted recovery steps for sessions that are stuck in the legacy tables. If your case turns out to be different, reply here and explain how, and we can reopen it.

  4. opencodejr
    closed this as duplicateon Nov 1, 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

    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.