opencode
opencode copied to clipboard
feat(core): add server.enabled config option to restore HTTP server
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: Addenabled: z.boolean().optional()to Server schema -
network.ts: ReturnenabledfromresolveNetworkOptions() -
thread.ts: AddnetworkOpts.enabled ||toshouldStartServercondition
Why
Since 982b71e ("disable server unless explicitly opted in"), users who need the HTTP server have no clean way to enable it:
-
port: 0fails (schema rejects non-positive) -
hostname: "127.0.0.1"doesn't trigger server (matches default) -
mdns: trueworks 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.