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 — /sessions empty after 1.x → 2.x migration in non-git directory (sessions orphaned under global project) · Issue #55142 · anomalyco/opencode

/sessions empty after 1.x → 2.x migration in non-git directory (sessions orphaned under global project) #55142

New issue
Copy link
New issue
Copy link
Closed as duplicate
Closed as duplicate
/sessions empty after 1.x → 2.x migration in non-git directory (sessions orphaned under global project)#55142
Copy link
Labels
pending closetriaging

Description

@estudiochapunov
estudiochapunov
opened on Oct 13, 2026
Issue body actions

/sessions empty after 1.x → 2.x migration in non-git directory (sessions orphaned under global project)

Environment

  • OpenCode v2.0.27 → v2.0.28, Linux (Mint 21.3)
  • Previous line: 1.x (sessions with version 1.3.2 … 1.19.0)
  • Working directory is not a git repo: /home/gabriel/Repos/privado

Symptom

  • /sessions in the TUI shows an empty list, although 104 sessions exist in ~/.local/share/opencode/opencode.db with directory = cwd.
  • all-sessions shows sessions from other directories but hides exactly the 104 of the cwd.
  • Standing in a git worktree (~/Repos/apl-educubo), all-sessions does show the 104. So data is intact; it is a listing/scoping bug, not data loss.

Root cause (verified in SQLite)

On first 2.0 launch (2026-10-12), a new per-directory project row was created:

ebdc21788a3e0c5e7df44d6630f17cf32003088b | /home/gabriel/Repos/privado | (no vcs)

but it holds 0 sessions: all 104 pre-existing sessions kept project_id = 'global' (the 1.x-era project, worktree /). Sessions created under git worktrees kept project ids that survived migration, so git dirs list fine — only the non-git cwd is orphaned:

project_id | count
global     | 131   (104 privado + 19 /tmp + 8 ~)
ebdc21…    | 0     (worktree = cwd, non-git)
d5a7b3…    | 11    (apl-educubo, git — lists fine)

/sessions resolves the current project by worktree (ebdc21…) → 0 rows → empty. all-sessions excludes the cwd group → the 104 are invisible exactly when standing in that directory.

Expected

Migration (or the list query) should backfill session.project_id from session.directory → project.worktree, or the session list should fall back to a directory match when the resolved project has no sessions.

Related

  • /sessions shows empty despite sessions existing in storage (v0.14.6) #3026 (/sessions empty despite sessions in storage — TUI not passing directory, server-cwd fallback; closed not-planned) — similar symptom, different mechanism.
  • [Bug] All sessions are gone #2987, OpenCode web sidebar sessions have disappeared #16562, r/opencodeCLI post-upgrade disappearance reports.

Local workaround applied

UPDATE session SET project_id='ebdc21…' WHERE directory='…' AND project_id='global';

(104 rows; DB backed up first.) /sessions lists them again after this.

Activity

  1. opencode-agent commented on Oct 13, 2026

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

    Thanks for the detailed write-up and the verified SQL diagnosis! I think this is a duplicate of #49827. After the V1→V2 migration, sessions that V1 created in non-git directories stay under the global project. V2 gives each of those directories its own project, so the per-directory session list hides them even though the data is intact.

    Possible duplicates and closely related issues, ordered from most to least likely:

    • migrate-v1: non-git sessions in "global" project hidden after V1→V2 upgrade #49827: the same problem. V1 global sessions from non-git directories are hidden after the upgrade. It is the main issue for this, and the open PR fix(core): attribute migrated V1 sessions to the project of their directory #51935 is meant to fix it.
    • V1→V2 importer keeps project_id='global' for non-git directories, so migrated sessions never appear in the per-directory session picker #50551: the same root cause, with an analysis of the importer code.
    • session: v1 "global" sessions stay unattributed after migration and are hidden from v2's session list #51176 / migration: v1 sessions imported under project 'global' are invisible in project session lists #50999 / v2: V1 sessions in non-git directories invisible after migration (legacy catch-all project) #50800 / cli: migrated v1 sessions from non-git dirs missing from session list #52919 / sessions: V1 sessions from non-git directories hidden from the project session list #53450 / migration: V1 sessions stay in the synthetic 'global' project after upgrading to V2 and vanish from the session list #55081 / migration: v1 sessions imported into "global" project, hidden from TUI session lists #55069: other reports of the same symptom.
    • v2: sessions with path=NULL (around v1's add_session_path schema change) are missing from project session lists #51144: a related case where sessions with path = NULL are missing from project session lists.

    A note on your workaround, from #54815: when you move sessions by hand, also set path = '' (not NULL). Otherwise the TUI list, which also filters on the subpath, may still hide them.

    The bot will close this issue as a duplicate in 1 day unless you reply explaining how your problem is different. Please follow #49827 and PR #51935 for updates.

  2. opencode-agent
    added
    pending close
    triaging
    on Oct 13, 2026
  3. opencode-agent
    closed this as duplicateon Oct 14, 2026
  4. opencode-agent commented on Oct 14, 2026

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

    We haven't heard back, so I'm closing this as a duplicate of #49827. V1 sessions from non-git directories stay under the global project after the V1→V2 migration, so V2's session list for that directory hides them. Please follow #49827 and the open fix PR #51935 for updates.

    Until the fix lands, your SQL workaround still works. If /sessions still hides any of them, also set path = '' (not NULL) on those rows. If your problem turns out to be different from #49827, reply here and we can reopen. Thanks again for the very clear diagnosis!

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.