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 — Upgrade to 1.17.x hides pre-existing sessions — new path column not back-filled during migration · Issue #35750 · anomalyco/opencode

Upgrade to 1.17.x hides pre-existing sessions — new path column not back-filled during migration #35750

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
Upgrade to 1.17.x hides pre-existing sessions — new path column not back-filled during migration#35750
Copy link
Assignees
nexxeln

Description

@Llanek
Llanek
opened on Jul 7, 2026
Issue body actions

Description

Summary
After upgrading the OpenCode binary from 1.14.29 → 1.17.14 (podman image), the session picker only shows a small subset of sessions. Older sessions (created on 1.14.29 and earlier) are hidden even though they are fully intact in opencode.db.

Environment
OpenCode: 1.14.29 → 1.17.14
Runtime: podman container (ghcr.io/anomalyco/opencode), data dir mounted from persistent volume at ~/.local/share/opencode
OS: WSL2 (Ubuntu), Windows host
Root cause
The session table gained a path column used to scope sessions within a project. The picker filters by (project_id, path). Sessions created before the upgrade have path = '' / NULL, while the current working directory (/workspace) now resolves to path = 'workspace'. Because the migration did not back-fill path for existing rows, those sessions no longer match the picker's filter and disappear.

Observed in opencode.db:

proj=global path='' n=7 <- hidden (incl. important sessions)
proj=global path='workspace' n=2 <- only these were visible

Workaround
Manually normalize the column while OpenCode is closed:

UPDATE session SET path = 'workspace'
WHERE directory = '/workspace' AND (path = '' OR path IS NULL);
Impact
Sessions appear "lost" to users after a routine image update, though no data is actually deleted.

Plugins

No response

OpenCode version

1.17.14

Steps to reproduce

Create sessions on 1.14.29 in a directory that maps to a non-root path (e.g. /workspace).
Upgrade the binary to 1.17.14.
Launch OpenCode from the same directory and open the session picker.
Only sessions that coincidentally have path='workspace' appear; all others are hidden.
Expected
Existing sessions should remain visible after upgrade. The migration that introduces the path column should back-fill it from each session's directory (relative to the project worktree).

Screenshot and/or share link

No response

Operating System

Windows 11. WSL2

Terminal

No response

Activity

  1. github-actions
    assigned
    nexxeln
    on Jul 7, 2026
  2. github-actions commented on Jul 7, 2026

    @github-actions
    github-actionsBot
    on Jul 7, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • Home sessions hidden from /sessions in global project #29581: Home sessions hidden from /sessions — identical root cause: sessions stored with empty path are filtered out when the picker queries by resolved path, causing older sessions to disappear.
    • Session history disappear after updating #35690: Session history disappears after updating to v1.17.14 — same symptom (sessions hidden after upgrade), though with a different underlying migration mechanism.
    • [sqlite] duplicate column name: cost migration error when upgrading from v1.14.41 to v1.17.11 #34584: SQLite migration error when upgrading from v1.14.41 to v1.17.11 — related upgrade/migration regression causing data access issues.
  3. Sharrmavishal commented on Jul 7, 2026

    @Sharrmavishal
    Sharrmavishal
    on Jul 7, 2026
    More actions

    Traced why the back-fill never happens. The column is added by 20260428004200_add_session_path.ts with a bare ALTER TABLE session ADD path text, so every pre-existing row gets NULL. The later 20260601010001_normalize_storage_paths.ts only rewrites rows where path IS NOT NULL, so it skips exactly those NULLs. Nothing else populates them, which is why the picker's (project_id, path) filter drops the older sessions.

    The UPDATE session SET path = 'workspace' workaround is correct for the /workspace case but not general. On create, path is derived in packages/core/src/session.ts:

    path: path.relative(project.directory, input.location.directory).replaceAll("\\", "/")

    so it's the session directory relative to its project worktree, posix-normalized. A correct back-fill has to reproduce that per row rather than write a fixed value, joining session to project (via projectID -> project.worktree) and computing the same relative path.

    path.relative is easier to get exactly right in JS than in SQL string ops (leading-separator trimming, .. when a session dir sits outside its worktree, Windows separators), so a data migration that selects the path IS NULL OR path = '' rows and updates each with path.relative(worktree, directory).replaceAll("\\","/") matches the create path exactly. Two cases to skip: legacy sessions with an empty directory (the directoryColumn comment in database/path.ts notes those exist) and any row whose directory resolves outside its worktree.

    This should also cover #35690 and #29581, which share the empty-path root cause.

    Happy to open a PR with that migration if the data-migration approach (vs a raw SQL back-fill) is the direction you'd prefer. Wanted to confirm before mutating existing rows.

  4. github-actions commented on Sep 6, 2026

    @github-actions
    github-actionsBot
    on Sep 6, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  5. github-actions
    closed this as not plannedon Sep 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @nexxeln
    nexxeln

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.