opencode icon indicating copy to clipboard operation
opencode copied to clipboard

opencode --port=8080 fails because port statically bound to 4096

Open kulesh opened this issue 1 month ago • 1 comments

Description

Was trying to test open code web interface per https://x.com/thdxr/status/2002786192534991106 and found that opencode won't work on ports other than 4096 (opencode --port=8080, for example).

In packages/desktop/src/app.tsx, when location.hostname includes "localhost", the code builds the URL using hardcoded values instead of using relative URLs that would resolve to the actual server origin.

A possible fix, thanks to Opencode+CC, is here: https://github.com/kulesh/opencode/pull/1/files but I am not sure if that's an acceptable/proper fix.

OpenCode version

1.0.185

Steps to reproduce

  1. Run opencode --port=8080
  2. Open http://localhost:8080 in browser
  3. Open DevTools Network tab
  4. Observe API calls going to http://127.0.0.1:4096 instead of port 8080

Screenshot and/or share link

Image

Operating System

macOS 26.1

Terminal

Ghostty

kulesh avatar Dec 22 '25 03:12 kulesh