-
Notifications
You must be signed in to change notification settings - Fork 14.9k
opencode --port=8080 fails because port statically bound to 4096 #5928
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingwebRelates to opencode on web / desktopRelates to opencode on web / desktop
Description
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
- Run
opencode --port=8080 - Open
http://localhost:8080in browser - Open DevTools Network tab
- Observe API calls going to
http://127.0.0.1:4096instead of port 8080
Screenshot and/or share link
Operating System
macOS 26.1
Terminal
Ghostty
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingwebRelates to opencode on web / desktopRelates to opencode on web / desktop