anomalyco / anomalyco/opencode
Web and desktop clients cannot authenticate with Unicode server credentials
@jlongster is already working on this.
Since Aug 30, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
The web and desktop clients pass username:password directly to btoa() when creating a Basic-auth token. btoa() accepts only binary strings, so credentials containing characters outside the one-byte range throw InvalidCharacterError. Characters such as ä do not throw, but are encoded as a single byte instead of UTF-8, so the server decodes a different password and rejects authentication.
This affects server health checks, protocol detection, API clients, and legacy terminal authentication because they share the same credential encoder. The server already generates and decodes Basic-auth credentials as UTF-8. The app should convert the credential string to UTF-8 bytes before applying standard Base64 encoding.
Plugins
N/A
OpenCode version
N/A (reproduced in the shared client authentication helper)
Steps to reproduce
- Start an OpenCode server with
OPENCODE_SERVER_PASSWORD='秘密🔐'. - Open the web or desktop client and add that server.
- Enter the same password and attempt to connect.
- Observe that encoding throws
InvalidCharacterErrorand the connection cannot be established.
A second case is päss: encoding does not throw, but the server receives invalid UTF-8 and authentication fails.
Expected behavior: Unicode usernames and passwords should be encoded as UTF-8 bytes before Base64 encoding and should authenticate successfully.
Screenshot and/or share link
Not provided; the credential helper provides a deterministic reproduction.
Operating System
All
Terminal
Web and desktop clients
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.