opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(core): add server.enabled config option to restore HTTP server

Open rmk40 opened this issue 1 day ago • 1 comments

Summary

Adds a server.enabled config option that explicitly enables the HTTP server for the TUI, restoring the pre-982b71e behavior for users who need external connections (desktop app, SDK, etc).

Fixes #8561

Usage

{
  "server": {
    "enabled": true
  }
}

Changes

  • config.ts: Add enabled: z.boolean().optional() to Server schema
  • network.ts: Return enabled from resolveNetworkOptions()
  • thread.ts: Add networkOpts.enabled || to shouldStartServer condition

Why

Since 982b71e ("disable server unless explicitly opted in"), users who need the HTTP server have no clean way to enable it:

  • port: 0 fails (schema rejects non-positive)
  • hostname: "127.0.0.1" doesn't trigger server (matches default)
  • mdns: true works but has unwanted side effects

This provides a clear, self-documenting opt-in with no side effects.

Testing

Tested locally - setting "server": { "enabled": true } in opencode.json correctly starts the HTTP server.

rmk40 avatar Jan 14 '26 23:01 rmk40