Skip to content

Conversation

@rmk40
Copy link
Contributor

@rmk40 rmk40 commented Jan 14, 2026

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.

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).

Usage in opencode.json:
  { "server": { "enabled": true } }

This provides a clear opt-in mechanism without relying on side effects
like setting hostname to 'localhost' or enabling mDNS.

Refs: 982b71e (disable server unless explicitly opted in)
@github-actions
Copy link
Contributor

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add server.enabled config option to explicitly enable HTTP server

1 participant