Skip to content

Sessions missing from sidebar on Windows due to path separator mismatch #23864

@Gitar101

Description

@Gitar101

Description

On Windows, sessions created by sub-agent tools (like the Task/invoke developer agent tool) do not appear in the web UI sidebar. The sidebar shows the project tile but lists zero sessions. The sessions are still accessible via direct URL.

Steps to Reproduce

  1. Run opencode serve on Windows
  2. Use a sub-agent tool that creates a child session
  3. Observe the sidebar: the project tile appears but lists zero sessions
  4. Navigate directly to the session URL: the session loads and works fine

Root Cause

The child store system uses raw directory strings as keys for Maps and Records. On Windows, the same directory path can arrive in two formats:

  • C:\Users\user\Desktop\project (backslashes, from server-sent events)
  • C:/Users/user/Desktop/project (forward slashes, from URL decoding)

These are the same logical path but different JavaScript string keys. The child store creates two separate entries. The sidebar reads from one key while the event handler writes to the other, so sessions vanish from the sidebar.

There are also two related bugs:

  1. loadSessions() uses globalSDK.client.session.list() instead of sdkFor(directory).session.list(), so the server defaults to process.cwd() instead of the requested project directory
  2. The path getter in child-store.ts returns directory: "" in its fallback case, causing isRootVisibleSession() comparisons to always fail

Environment

  • Windows 11
  • OpenCode serve mode (web UI)
  • Any browser

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions