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 — OpenCode Sessions Bug Report · Issue #30652 · anomalyco/opencode

OpenCode Sessions Bug Report #30652

New issue
Copy link
New issue
Copy link
Closed
Closed
OpenCode Sessions Bug Report#30652
Copy link
Assignees
StarpTech

Description

@gitChang
gitChang
opened on Jun 4, 2026
Issue body actions

Description

Bug Report: /sessions command returns empty despite DB having 86 sessions

Environment

  • opencode version: 1.15.13
  • OS: Ubuntu 26.04 LTS (Linux 7.0.0-22-generic x86_64)
  • Install method: fnm-managed npm global
  • Config: No ~/.config/opencode/opencode.json, no project-level opencode.json

Steps to Reproduce

  1. Use opencode for multiple sessions over several days.
  2. Run /sessions command in the CLI.

Expected Behavior

/sessions should list all available session history entries, showing recent sessions first.

Actual Behavior

/sessions returns an empty list — no sessions displayed.

Evidence

The sessions ARE present in the SQLite database with valid data:

$ sqlite3 ~/.local/share/opencode/opencode.db "SELECT COUNT(*) FROM session;"
86

$ sqlite3 ~/.local/share/opencode/opencode.db "SELECT COUNT(*) FROM session_message;"
440

Sample session records (from direct DB query):

id slug title time_created time_updated model
ses_XXXXXXXXXX... random-slug Session title (redacted) 1778215695362 1780538253228 some-model
ses_XXXXXXXXXX... another-slug Another session title (redacted) 1778670095419 1780538150903 some-model
ses_XXXXXXXXXX... third-slug Another session title (redacted) 1780537992210 1780538061954 some-model
  • WAL checkpoint: PRAGMA wal_checkpoint(TRUNCATE) returns 0|0|0 (no pages in WAL, all data in main DB).
  • No global or project config — no compaction rules that could have cleared sessions.

Impact

User cannot browse or restore previous sessions via the CLI. If there is no other way to retrieve session IDs, all conversation history is effectively lost.

Expected Fix

The /sessions CLI command should query the session table correctly and display available sessions. The current query may be using wrong column names (e.g., created_at/updated_at instead of time_created/time_updated), which would silently produce empty results when no rows match.

Additional Context

  • The DB file is 117MB (opencode.db) + WAL files, confirming real data exists.
  • No recent compaction errors in logs (checked ~/.local/share/opencode/log/).

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions
    assigned
    StarpTech
    on Jun 4, 2026
  2. github-actions commented on Jun 4, 2026

    @github-actions
    github-actionsBot
    on Jun 4, 2026 – with GitHub Actions
    Contributor
    More actions

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

    • TUI session list empty despite sessions existing in database #26960: TUI session list empty despite sessions existing in database (same symptom: sessions in DB but not shown in session list)
    • # Bug Report: session list Command Not Displaying Historical Sessions #29060: session list Command Not Displaying Historical Sessions (same symptom: DB has many sessions but list shows very few)
    • [Regression] Historical chat sessions disappear after upgrading from v1.15.11 to v1.15.13 when using opencode web #30054: [Regression] Historical chat sessions disappear after upgrading from v1.15.11 to v1.15.13 (same version 1.15.13, sessions missing from UI)
    • Home sessions hidden from /sessions in global project #29581: Home sessions hidden from /sessions in global project (related filtering/query issue)

    If your issue is not addressed by any of these, please add details about what differentiates your case.

    Reacted by CharlieGP
  3. gitChang commented on Jun 5, 2026

    @gitChang
    gitChang
    on Jun 5, 2026
    Author
    More actions

    Turns out this was the #29581 bug — old sessions had empty path fields, so the TUI session query filtered them out.
    Closure:

    • Home sessions hidden from /sessions in global project #29581 was the root cause (path filter mismatch for home-sourced sessions).
    • Applied the DB workaround locally: UPDATE session SET path = substr(directory, 2) WHERE path IS NULL OR path = ''; — backfilled path from directory for 47 orphaned sessions. All 91 sessions now visible in TUI.
    • This is effectively a duplicate of Home sessions hidden from /sessions in global project #29581 (already fixed by PR fix(tui): show home sessions in global project #29582).
      Closing as resolved.
  4. gitChang
    closed this as completedon Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @StarpTech
    StarpTech

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.