anomalyco / anomalyco/opencode
cli: TUI fails to connect to password-protected explicit server via --server
Open
@simonklee is already working on this.
Since Sep 17, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Summary
opencode --server <url> against a password-protected opencode serve always fails the startup health check with UnsupportedContentType, in all credential forms. The same URL works with opencode run and opencode api, so the server side is fine — only the TUI startup path fails.
Environment
- opencode version: 2.0.5
- OS: Linux 7.2.6-arch2-1 (linux x64)
- Terminal: Unavailable: terminal environment variables are not set
- Shell: /usr/bin/bash
- Install/channel: latest
- Active plugins: Omitted at reporter's request
Reproduction
- Start a password-protected server:
opencode serve --hostname 0.0.0.0 --port 4096withOPENCODE_SERVER_PASSWORDset. - Run
opencode --server http://127.0.0.1:4096— fails. - Retry with credentials in URL (
http://opencode:<pass>@127.0.0.1:4096) and as?auth_token=<base64(user:pass)>— both fail identically. - Run
opencode run --server "<auth_token form>" "hi"— succeeds.opencode api --server "<userinfo form>" get /api/status— succeeds.
Expected Behavior
The TUI connects to the explicit server the same way run and api do.
Actual Behavior
Error: Server at http://127.0.0.1:4096 did not provide a compatible V2 health response ... [cause]: ClientError: UnsupportedContentType
Unauthenticated /api/status returns 401 with an empty body, so the TUI check appears to send no credentials in any URL form.
Additional Context
- The
cli.jsonschema has no default-server field, so--servercannot be defaulted; aliases/functions are the only workaround, and they hit this bug. - No doc describes TUI
--serverauthentication (CLI, Web, Commands, and client guides checked).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.