anomalyco / anomalyco/opencode

opencode web: server tidak mount route API v2 (model/default, project/current, generate)

Open
#42,565 0 comments 0 reactions 1 assignee View on GitHub

@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

  1. Start the server with the command above.
  2. Open the web UI served by that server and create or open a session.
  3. Submit a message from the frontend.
  4. Inspect the network requests and response content.

Observed behavior

  • GET /api/health, /api/location, /api/agent, /api/session, message reads, and /api/session/active are available.
  • GET /api/model/default, /api/project, /api/project/current, and /api/config return the HTML fallback instead of the API response.
  • POST /api/session/{id}/generate returns 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 attach can 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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.