Skip to content

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

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

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