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
- Run
opencode serve on Windows
- Use a sub-agent tool that creates a child session
- Observe the sidebar: the project tile appears but lists zero sessions
- 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:
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
- 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
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
opencode serveon WindowsRoot 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:
loadSessions()usesglobalSDK.client.session.list()instead ofsdkFor(directory).session.list(), so the server defaults toprocess.cwd()instead of the requested project directorypathgetter inchild-store.tsreturnsdirectory: ""in its fallback case, causingisRootVisibleSession()comparisons to always failEnvironment