Skip to content

desktop: all projects show no sessions — session list fails with 'Path is not absolute: .' from a legacy session row (v1.18.31, Windows) #49256

Closed as not planned

Description

@techbard-source

Summary

On Windows, OpenCode Desktop (stable 1.18.31) shows no sessions under any project ("아직 아무것도 없습니다 / 세션을 생성하시 시작하세요"). The session list fails to load because at least one legacy session row has a non-absolute directory value ("." or "/"), which trips a path assertion:

Error: Path is not absolute: .

Since the list query (V2Session.list) validates/decodes every row, one malformed row breaks the entire session list, so every project appears empty — even though 433 sessions exist in the DB.

Environment

  • opencode desktop: 1.18.31.0 (%LOCALAPPDATA%\Programs\OpenCode\OpenCode.exe)
  • opencode CLI: 1.18.31
  • OS: Windows 11 Enterprise, build 26100 (AMD64)
  • DB: %USERPROFILE%\.local\share\opencode\opencode-desktop.db (same rows also exist in opencode.db)

Steps to reproduce

  1. Have a session row whose directory is not an absolute path (e.g. "." or "/") — from legacy sessions (version 1.2.x, ACP/Codex).
  2. Launch the desktop app and open any project.
  3. The project's session list is empty; the server log shows the error below. The same happens for all projects.

Expected behavior

Sessions list normally. A single malformed/legacy row should not fail the entire list.

Actual behavior

GET /api/session (session list) fails; the UI shows no sessions for every project.

Server log (%USERPROFILE%\.local\share\opencode\log\opencode.log):

level=ERROR message=failed error="EffectDrizzleQueryError: Failed query: select \"id\", \"project_id\", \"workspace_id\", \"parent_id\", \"slug\", \"directory\", \"path\", \"title\", \"version\", ... from \"session\" order by \"session\".\"time_created\" desc, \"session\".\"id\" desc limit ?
params: 5000 (cause: Cause([Fail(Error: Path is not absolute: .)]))"
    at V2Session.list (file:///.../app.asar/out/main/chunks/node-Cc1MVJxA.js:733450:40)
    ...
  [cause]: Error: Cause([Fail(Error: Path is not absolute: .)])

DB evidence

SELECT id, directory, path, title, project_id, version FROM session
WHERE directory IN ('.', '/', '') OR directory IS NULL;

Result (present in both opencode-desktop.db and opencode.db):

ses_3905a52d4ffewsWT8Upaxth7fs  directory='.'  title='ACP Session d63e4d24-59e0-455d-92d1-46eb7fec80a1'  project_id='global'  version='1.2.4'
ses_3a1418943ffeufvbTzooPhgAAb  directory='/'  title='현재 codex 연결 여부 확인 대화'                         project_id='global'  version='1.2.3'

Total sessions: 433; non-absolute directory: 2.

Root cause (analysis)

A path helper asserts that a location is absolute. The session list validates each row's location, so a single legacy row with directory="." throws and the whole list request fails, leaving every project's session list empty. This looks like the same "Path is not absolute" assertion family seen in the workspace=global reports, but here the offending value is a stored session directory ("."), it affects stable 1.18.31 on Windows, and the failure is data-driven rather than workspace-driven.

Impact

All projects show no sessions in the desktop UI even though sessions exist in the DB. Data is intact.

Workaround

With the app closed, normalize/repoint the offending rows:

UPDATE session
SET directory = 'C:/Users/<user>'
WHERE directory IN ('.', '/', '') OR directory IS NULL;

After this, the session list renders again.

Suggested fix

  • Skip or normalize rows with a non-absolute directory instead of failing the whole list.
  • Add a migration to repair legacy rows where directory is in ('', '.', '/').
  • Consider hardening the path normalization used by Session.list.

Related

Activity

  1. thdxr commented on Oct 11, 2026

    @thdxr
    Member

    Thanks for the report! OpenCode 2.0 is now out and development is focused on V2, so we're closing issues filed against OpenCode 1. Please upgrade (opencode upgrade --major, details: https://anoma.ly/notes/opencode-2-0), and if this is still relevant on 2.0, reopen this issue or open a new one with your 2.0 version.

    — from 𝕺𝖕𝖊𝖓𝕮𝖔𝖉𝖊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

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