Description
Four issues in the Web UI when OpenCode is accessed via browser (not desktop app):
-
"New Session" button creates session in wrong project — clicking New Session from homepage defaults to the first non-global registered project instead of the project the user is working in. Workaround: navigate to specific project's session URL first, then click New Session.
-
POST /project/init returns HTML instead of JSON — API endpoint that should register a new project returns the SPA HTML page, making programmatic project registration impossible.
-
Settings page missing Projects tab — Web UI Settings has no way to add/manage projects. Only desktop TUI can do this.
-
Auto-accept permissions toggle broken — The toggle in Web UI Settings > Agent cannot be enabled; clicking has no effect (desktop TUI works fine).
OpenCode version
Latest from npm (opencode-ai), version 1.16.2
Steps to reproduce
- Start server:
opencode web --port 4096 --hostname 0.0.0.0
- Open browser at http://127.0.0.1:4096/
- Click "New Session" on homepage — session created in wrong project
- Settings page: check for Projects tab (missing), try toggle Auto-accept (broken)
- API:
curl -X POST http://127.0.0.1:4096/project/init -H "Content-Type: application/json" -d "{\"directory\":\"D:\\\path\\\to\\\workspace\"}" — returns HTML
Operating System
Windows 11
Terminal
Windows Terminal (not relevant — these are Web UI bugs)
Plugins
None — vanilla opencode-ai npm install
Description
Four issues in the Web UI when OpenCode is accessed via browser (not desktop app):
"New Session" button creates session in wrong project — clicking New Session from homepage defaults to the first non-global registered project instead of the project the user is working in. Workaround: navigate to specific project's session URL first, then click New Session.
POST /project/init returns HTML instead of JSON — API endpoint that should register a new project returns the SPA HTML page, making programmatic project registration impossible.
Settings page missing Projects tab — Web UI Settings has no way to add/manage projects. Only desktop TUI can do this.
Auto-accept permissions toggle broken — The toggle in Web UI Settings > Agent cannot be enabled; clicking has no effect (desktop TUI works fine).
OpenCode version
Latest from npm (opencode-ai), version 1.16.2
Steps to reproduce
opencode web --port 4096 --hostname 0.0.0.0curl -X POST http://127.0.0.1:4096/project/init -H "Content-Type: application/json" -d "{\"directory\":\"D:\\\path\\\to\\\workspace\"}"— returns HTMLOperating System
Windows 11
Terminal
Windows Terminal (not relevant — these are Web UI bugs)
Plugins
None — vanilla opencode-ai npm install