Description
When running opencode --web, the left panel session list is always empty in the web UI, even though /api/session returns sessions correctly.
Root Cause (Analysis)
The frontend loads sessions via SSE event-driven logic. When server.connected is received, the code iterates M.children (registered workspaces) to trigger session loading. However M.children is empty at the time the event arrives, so no sessions are ever loaded.
Related Bug
Sessions with time_archived stored as Unix millisecond integer cause /api/session to return 400 BadRequest for the entire list. The API schema expects DateTime.Utc. Workaround: set time_archived = NULL in SQLite DB.
Plugins
None
OpenCode version
v1.15.0
Steps to reproduce
- Start opencode in web server mode:
opencode --web 0.0.0.0:4096
- Open browser, navigate to the web UI
- Left panel session list is empty
/api/session API returns sessions correctly
- Search works and can find sessions
- Reproduced in incognito mode, different browsers, different devices
Screenshot and/or share link
Operating System
Windows 11 running web server in WSL
Terminal
Web server mode (--web)
Description
When running
opencode --web, the left panel session list is always empty in the web UI, even though/api/sessionreturns sessions correctly.Root Cause (Analysis)
The frontend loads sessions via SSE event-driven logic. When
server.connectedis received, the code iteratesM.children(registered workspaces) to trigger session loading. HoweverM.childrenis empty at the time the event arrives, so no sessions are ever loaded.Related Bug
Sessions with
time_archivedstored as Unix millisecond integer cause/api/sessionto return400 BadRequestfor the entire list. The API schema expectsDateTime.Utc. Workaround: settime_archived = NULLin SQLite DB.Plugins
None
OpenCode version
v1.15.0
Steps to reproduce
opencode --web 0.0.0.0:4096/api/sessionAPI returns sessions correctlyScreenshot and/or share link
Operating System
Windows 11 running web server in WSL
Terminal
Web server mode (
--web)