anomalyco / anomalyco/opencode
opencode web: server tidak mount route API v2 (model/default, project/current, generate)
@Hona is already working on this.
Since Aug 14, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- Avg merge
- 7h 2m
- Merged PRs (30d)
- 384
Description
Summary
OpenCode Web in 1.18.18 serves a frontend bundle that calls API v2 routes which the same server does not mount. The result is that the built-in web UI loads, but cannot send a message.
Environment
- Windows 11
- OpenCode CLI 1.18.18 (npm latest at the time of testing)
- Also reproduced with 1.18.16 in an isolated installation
- Server started with
opencode web --hostname 127.0.0.1 --port 4096 - Authenticated localhost server; no public bind or Funnel
Reproduction
- Start the server with the command above.
- Open the web UI served by that server and create or open a session.
- Submit a message from the frontend.
- Inspect the network requests and response content.
Observed behavior
GET /api/health,/api/location,/api/agent,/api/session, message reads, and/api/session/activeare available.GET /api/model/default,/api/project,/api/project/current, and/api/configreturn the HTML fallback instead of the API response.POST /api/session/{id}/generatereturns HTTP 200 with the HTML fallback instead of a JSON generation response.- The frontend bundle served by the same server requests the missing v2 routes, so the UI cannot complete message submission.
- CLI
opencode attachcan connect to the server in an interactive TUI, which suggests the server/session path itself is available while the web API surface is inconsistent.
Expected behavior
The server and the frontend shipped in the same release should agree on the API route version. The v2 routes requested by the frontend should be mounted and return the documented JSON responses, or the frontend should use the routes actually exposed by the server.
Request
Please check the release/build packaging or route registration that causes the server's web frontend and API route table to be out of sync.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.