Skip to content

Web UI on Windows: sessions not displayed due to path separator mismatch in /session API queries #25565

Closed as duplicate

Description

@mlopez-firestorm

Description

Summary

When accessing the OpenCode web UI on Windows (via browser, not the Electron/Tauri desktop app), existing sessions are not displayed in the sidebar. The Electron app connected to the same server shows sessions correctly.

Root Cause

The web UI's JavaScript client sends the directory query parameter with forward slashes (C:/Users/...) when fetching sessions via GET /session?directory=...&roots=true, but the server stores directory paths with backslashes (C:\Users\...). The server does an exact string match, so the query returns an empty array.

Evidence:

  • GET /session?directory=C%3A%2FUsers%2FManuel%2F...&roots=true → returns []
    • GET /session?directory=C%3A%5CUsers%5CManuel%5C...&roots=true → returns sessions correctly
      Interestingly, the /session/status endpoint in the same web UI uses backslashes correctly — only the session list query uses forward slashes.

Steps to Reproduce

  1. Start opencode serve on Windows with --port 4200
    1. Create sessions via the Electron desktop app or CLI
    1. Open http://localhost:4200 in a web browser
    1. Navigate to a project — the sidebar shows "New session" but no existing sessions

Expected Behavior

The web UI should display existing sessions, matching the behavior of the Electron desktop app.

Suggested Fix

Normalize path separators (replace / with \ on Windows) on the server side when processing the directory query parameter in the /session endpoint. Alternatively, fix the client-side JavaScript to consistently use the OS-native path separator.

Workaround

A reverse proxy on localhost that rewrites forward slashes to backslashes in the directory query parameter partially fixes the session listing. However, the web UI still has a secondary rendering issue where sessions are fetched but not displayed — possibly related to project ID mapping (projectID: "global" vs directory-based project views).

Environment

  • OpenCode v1.14.31
    • Windows 10
      • Tested in Chrome and via Tailscale remote access on iOS Safari

Plugins

None

OpenCode version

1.14.31

Steps to reproduce

a1. Start opencode serve --port 4200 on Windows
2. Create sessions via the Electron desktop app
3. 3. Open http://localhost:4200 in a web browser
4. 4. Navigate to a project — sidebar shows "New session" but no existing sessions

Screenshot and/or share link

No response

Operating System

Windows 10

Terminal

N/A (web browser - Chrome / iOS Safari via Tailscale)

Activity

  1. github-actions commented on May 3, 2026

    @github-actions
    Contributor

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

    Please review those issues and consider closing this one if it covers the same problem.

  2. mlopez-firestorm commented on May 3, 2026

    @mlopez-firestorm
    Author

    Closing as duplicate of #21340 and #23864.

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