anomalyco / anomalyco/opencode
desktop: all projects show no sessions — session list fails with 'Path is not absolute: .' from a legacy session row (v1.18.31, Windows)
@kitlangton is already working on this.
Since Sep 16, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
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 inopencode.db)
Steps to reproduce
- Have a session row whose
directoryis not an absolute path (e.g."."or"/") — from legacy sessions (version1.2.x, ACP/Codex). - Launch the desktop app and open any project.
- 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
directoryinstead of failing the whole list. - Add a migration to repair legacy rows where
directoryis in('', '.', '/'). - Consider hardening the path normalization used by
Session.list.
Related
- #42532 — server: workspace=global requests return 500 'Path is not absolute: global'
- #42266 — desktop: bundled sidecar crashes with 'Path is not absolute: global'
- #33550 — Desktop sends Windows-native paths ... breaking session list with "Path is not absolute"
- #37096 / #42668 — session list empty on Windows / Web
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.