Repository navigation
Conversation
|
This PR doesn't fully meet our contributing guidelines and PR template. What needs to be fixed:
Please edit this PR description to address the above within 72 hours, or it will be automatically closed. If you believe this was flagged incorrectly, please let a maintainer know. |
There was a problem hiding this comment.
The new section is accurate about the commands: service get, service set and service unset work as written for port and hostname, and the default port is the same for every account on a machine. I checked this against the code on dev; there was nothing to run for a docs-only change.
Public API: unchanged (docs only).
Two sentences need correcting before this is ready, both noted inline: the error message the section quotes isn't the one users see, and the disabled alternative still uses a (random) port and turns off pairing.
Optional: cli/web.mdx (Configure section) already shows service set port and service set hostname, so linking to it would keep the two pages in sync.
|
|
||
| The service's default port is the same for every user account on the machine, while the service configuration is per user. When two | ||
| accounts run OpenCode at the same time — shared Windows machines are the common case — the second account's service cannot bind the | ||
| default port and its clients fail with "port is in use by another process". Give the account its own port: |
There was a problem hiding this comment.
This error text doesn't exist in the code. The actual message (packages/cli/src/server-process.ts:181) is:
Managed service port <port> on <host> is already in use by <process>. Configure another port with `opencode service set port <port>` and start the service again.
Please quote that wording, e.g. "Managed service port … is already in use", so users who search for the error land here.
"With no port at all" isn't accurate. With disabled set to true, each start runs a standalone server on a random free port (--port 0 in services/standalone.ts). It's also worth noting the trade-off: while the service is disabled, opencode pair (web and app pairing) refuses to run, because it needs the background service.
|
This pull request has been automatically closed because it was not updated to meet our contributing guidelines within the 72-hour window. Feel free to open a new pull request that follows our guidelines. |
Adds a "Change the service port" section to the troubleshooting page, after "Allow a browser origin".
The service's default port is machine-global while the service configuration is per user, so on machines where several accounts run OpenCode at the same time (multi-user Windows is the common case) the second account's service cannot bind the default port and fails with "port is in use by another process" — with nothing in the docs pointing at the fix. The
portandhostnameservice keys exist and work, but neither the troubleshooting page nor the CLI docs mention them: the documentedservice setexamples cover onlycorsanddisabled, and the web docs' default-port table says only "You can change this config with theopencode servicecommand" without showing how.The new section covers
service set port/get/unset, the per-user storage and next-start semantics, thehostnamesibling key, and theservice set disabled truealternative for accounts that want no shared service at all. All commands verified on 2.1.1 and 2.2.6: the service binds exactly the configured port on next start,service get portprints the value, andservice unset portrestores the default.Refs #62749
Added by the opencode bot (AI-generated).
Related: #62749, #50672, #56792