Skip to content

Web UI: New Session creates in wrong project, /project/init returns HTML, Settings missing Projects tab, Auto-accept toggle broken #31272

@VictorHuy2711

Description

@VictorHuy2711

Description

Four issues in the Web UI when OpenCode is accessed via browser (not desktop app):

  1. "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.

  2. 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.

  3. Settings page missing Projects tab — Web UI Settings has no way to add/manage projects. Only desktop TUI can do this.

  4. 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

  1. Start server: opencode web --port 4096 --hostname 0.0.0.0
  2. Open browser at http://127.0.0.1:4096/
  3. Click "New Session" on homepage — session created in wrong project
  4. Settings page: check for Projects tab (missing), try toggle Auto-accept (broken)
  5. 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

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