Skip to content

[Windows] Web UI not showing sessions - path separator mismatch (backslash vs forward slash) #21340

Closed

Description

@duyiliu

Description

On Windows, the Web UI does not display session history, while the Desktop version works correctly.

Root Cause Analysis

After investigation, I found that the issue is caused by path separator mismatch between the database storage and Web API queries:

Component Path Format Example
Database (sessions.directory) Backslash \ C:\Users\zhangqianfeng
Web API query Forward slash / C:/Users/zhangqianfeng

API Test Results

# Query with backslash (Windows native) - WORKS
GET /session?directory=C:\Users\zhangqianfeng&roots=true&limit=55
→ Returns 11 sessions ✅

# Query with forward slash (Web UI format) - FAILS
GET /session?directory=C:/Users/zhangqianfeng&roots=true&limit=55
→ Returns 0 sessions ❌

The data exists in the database, but Web UI queries with forward slashes fail to match the backslash-stored paths.

Environment

  • OpenCode version: v1.3.17
  • OS: Windows 11
  • Terminal: PowerShell / Windows Terminal

Steps to Reproduce

  1. On Windows, create sessions using Desktop app or CLI
  2. Open Web UI (localhost:4096)
  3. Sessions are not displayed in the sidebar
  4. Desktop app shows all sessions correctly

Expected Behavior

Web UI should display all sessions that exist in the database, regardless of path separator format.

Actual Behavior

Web UI shows empty session list because path matching fails.

Related Issues

Suggested Fix

The API should normalize path separators before querying/matching, converting both \ and / to a canonical format.

Workaround

  • Use Desktop version (reads local data directly, bypasses the path matching issue)
  • Or access sessions directly via URL: http://localhost:4096/session/{session_id}

Activity

  1. added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on Apr 7, 2026
  2. github-actions commented on Apr 7, 2026

    @github-actions
    Contributor

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

    If your issue is distinct from those, please add context explaining how it differs.

  3. SangLiang commented on Apr 16, 2026

    @SangLiang

    Same bug, I have never been able to see the session list on Windows. I thought it was designed that way. It wasn't until one day when I used it on Ubuntu that I saw a clear session list panel. Then I knew they must have made a mistake on Windows.

  4. chenhui-su commented on Apr 25, 2026

    @chenhui-su

    I’m having a similar issue in some ways. I can’t see the session list on Windows — not even sessions I’ve just created under the same project in the same web service show up. The local version is 1.14.24, while the web UI shows OpenCode Desktop v1.14.23. Maybe I need to switch to WSL to check if it’s the same problem…


    2026-05-01 now it works fine

  5. kendrick-jmancurly commented on Apr 27, 2026

    @kendrick-jmancurly

    I can confirm this still reproduces on Windows with OpenCode 1.14.28.

    Environment

    • OS: Windows 11
    • OpenCode: 1.14.28
    • UI: opencode web
    • Browsers tested: Brave, Chrome, Edge

    Symptom

    • Creating a new session works and the chat itself continues normally.
    • The new session does not appear in the Web sidebar/session list.
    • Restarting the browser and rebooting Windows did not resolve it.
    • This appears project-specific: other projects on the same machine usually show sessions normally.

    Evidence

    The sessions are being persisted. In the local OpenCode database, I can see unarchived root session rows for the affected project:

    • parent_id IS NULL
    • time_archived IS NULL
    • session directory is stored using a Windows backslash path format

    So this does not look like browser storage loss. It looks like the Web sidebar/session loader is failing to list/render sessions that already exist, likely due to directory/path matching or project-context mismatch.

  6. KyleL1 commented on Apr 30, 2026

    @KyleL1

    Has anyone found a workaround while using opencode web on windows? I noticed that git worktree folders do seem to work fine, but the main repo folder does not show sessions.

  7. removed
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  8. hmannekomimi-ctrl2 commented on May 24, 2026

    @hmannekomimi-ctrl2

    Cross-referencing: A new report (#29071) documents the same underlying issue — session_directory_filter_enabled default + path resolution mismatch between Desktop and CLI causing sessions to be hidden, with a workaround ("session_directory_filter_enabled": false in kv.json).

  9. wlclass commented on Jun 1, 2026

    @wlclass

    This problem has existed for a long time and it is the most painful aspect for me.

  10. Hona commented on Jul 2, 2026

    @Hona
    Member

    Fixed in v1.16.0 by #29666.

    Path separators are now handled at the database boundary: session/project path columns are Drizzle custom types (packages/core/src/database/path.ts) that store forward slashes on Windows and normalize query parameters bound in eq(), so / and \ forms of the same path match the same rows. A one-time migration (20260601010001_normalize_storage_paths) rewrote existing backslash rows.

    Please upgrade to >= v1.16.0. If the session list is still wrong on a current release, comment with opencode --version and a sample directory value from the session table and we will reopen.

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